Writing ActiveX controls in C # (III)

Source: Internet
Author: User
Tags relative domain name
Active|activex| Control

We've already developed the ActiveX control in the front, and it's the next thing to publish it.

First, we set up a Windows Setup project and add the primary output of the ActiveX control to the project output. Then, change the main output file of the ActiveX control and change its Register property to vsdrpcom. Figure:



Next, we change the project properties and change the bootstrapper to the Web bootstrapper. Unfortunately, you must use an absolute path in the installation folder URL in the Web bootstrapper settings, and you cannot use a relative path. This means that when you build the installer, you must determine the path, which is not very convenient.    In the example, I used localhost, which can be changed to the actual domain name in the publication. Now we build the installer and copy the appropriate program to the correct directory (in this case, the default site directory in the ActiveX folder). We can execute the Setup.Exe file directly to verify the correctness of the installation files.     Executed correctly on my machine and succeeded! Now we have to change the helloworld.htm file again. The revised results are as follows: <body bgcolor= ' #223344 ' > <object id= ' HelloWorld ' classid= ' clsid : 9551B223-6188-4387-B293-C7D9D8173E3A "width=" 184 "height=" codebase= "Activex/setup.exe" > </object> <br> <input type= ' button ' onclick= ' HelloWorld. ShowMessage ("Hello world!") ' value= ' click ' > </body> Note that we have added the CODEBASE attribute to the object block, which is the location of the downloaded control, and you can use a relative path. Don't be busy, we can't request this page right now because we haven't signed our controls yet. There are two ways to sign a signature, one is to sign the installer when it is built, and the other is to use the Sn.exe signature. It is recommended that you use the latter because you can provide more options. I am very lazy, do not write more, you can refer to csdn on the article "Release ActiveX." To give you a wake-up call, select an advanced certificate application when applying for a certificate. This is the end of writing ActiveX controls in C #. If you have any questions, you can leave a message with me.

NEW: Source Download

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.