An ActiveX control, formerly known as an OLE control, is a software component or object supported by Microsoft IE that can be inserted into a Web page to perform dynamic program functions on the browser side to enhance the dynamic processing capabilities of the browser side. Typically, ActiveX controls are developed in the C + + or VB language, and this article describes another way to develop ActiveX controls using the C # language.
Recently, a feature that uses C # controls in Qt is used to produce ActiveX controls in C # and use the ActiveX control in Qt. This article briefly describes how to build ActiveX controls in C #.
1. Establish the WinForm UserControl project, select "Make assembly COM visible" in the control's property page
Assign a GUID, add GuidAttribute to the control, and the GUID defined here is the GUID of your ActiveX control.
2. Compile run, compile run (requires Administrator privileges) can be easily tested by the system's user Control Test Container,
3. Publishing DLLs
C # ActiveX controls need to be registered with the REGASM program, using the following methods:
注册 regasm /codebase xxx.dll
卸载 regasm /u xxx.dll
Also, if the DLL relies on other DLLs, it should be published together.
The above is the content of the code details of developing ActiveX controls using C #, more about topic.alibabacloud.com (www.php.cn)!