SoFunction
Updated on 2025-03-06

Writing ActiveX controls in C# (III)

We have completed the development of ActiveX controls before, and the next thing is to release it.

First, we set up a windows installation project and add the main 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. As shown in the figure:

Next, we change the project properties and change the bootloader to a web bootloader. Unfortunately, absolute paths must be used in the installation folder URL in the Web Bootstrap Settings, and relative paths cannot be used. This means that when generating 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 publish.

 

Now we generate the installer and copy the corresponding program to the correct directory (in this case, it is the ActiveX folder under the default website directory). We can execute files directly to verify the correctness of the installation files. It was executed correctly on my machine, and it worked!

 

 

Now we have to change the file again. The modified results are as follows:

 

<body bgcolor='#223344'>

 

<object

 

   class0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="a" w:st="on">3A" Width="184" Height="96" codebase="ActiveX/"

 

>

 

</object>

 

<br>

 

<input type='button' onclick='("Hello World!")' value='Click'>

 

</body>

 
Note that we have added the codebase attribute to the object block, which is the location of the defined download control, and you can use the relative path. Don't be busy, we can't request this page correctly yet, because we haven't signed our control yet. There are two ways to sign, one is to sign when the installer is generated, and the other is to use signature. We recommend that you use the latter because there are more options available. I am very lazy, so I won't write more. You can refer to the article on csdnPublish ActiveX. Let me remind you first, and choose to apply for advanced certificates when applying for a certificate.
 
Source code download:Blog Park Download   Download this site