Use C # To compile ActiveX Controls (3)

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 Web boot. 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-C7D9D8173E 3A "Width =" 184 "Height =" 96 "codebase =" ActiveX/Setup. Exe"

>

</Object>

<Br>

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

</Body>

Note: We have added the codebase attribute to the object block. This is the location of the developed 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. The signature can be in two ways: one is the sign-in when the installation program is generated, and the other is the signature using sn.exe. We recommend that you use the latter because more options are available. I am too lazy to write more. You can refer to the article "publishing ActiveX" on csdn. First, I will remind you to apply for an Advanced Certificate when applying for a certificate. Download source code: download this site from the blog site
Related Article

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.