Compile ActiveX Control with C # (3) reprinted

Source: Internet
Author: User

We have developed ActiveX controls before, and then we will release them.

First, create a Windows installation project and add the main output of the ActiveX control to the project output. Then, modify the main output file of the ActiveX control and change its register attribute to vsdrpcom .:

Next, we will change the project properties to guideProgramChange to Web boot program. Unfortunately, absolute paths must be used in the installation folder URL in the Web boot program settings, and relative paths cannot be used. This means that the path must be determined when the installation program is generated, which is not very convenient. In the example, I used localhost. In the release, I can change it to the actual domain name.

Now we generate the installer and copy the corresponding program to the correct directory (in this example, the ActiveX folder under the default website directory ). We can directly execute the setup. EXE file to verify the correctness of the Installation File. It is successfully executed on my machine!

Now we have to change the helloworld.htm file again. The modified result is as follows:

<Body bgcolor = '#223344'>

<Object ID = "helloworld"

Classid = "CLSID: 9551b223-6188-4387-b293-c7d9d8173e3a" width = "184" Height = "96" codebase = "ActiveX/setup. EXE"

>

</Object>

<Br>

<Input type = 'button 'onclick = 'helloworld. showmessage ("Hello world! ") 'Value = 'click'>

</Body>

Note:ObjectAdded to the blockCodebaseProperty, which is the location of the specified download control. You can use the relative path. Don't be too busy. We still cannot request this page correctly because we haven't signed our controls yet. You can use either of the following two methods to sign an installer:Sn.exeSignature. We recommend that you use the latter because more options are available. I am very lazy and won't write more. You can referCsdnOnArticlePublishing ActiveX". Let's give you a wake-up question. When applying for a certificate, choose Apply for an Advanced Certificate.

So farC #WriteActiveXControl. If you have any questions, please leave a message with me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.