VS2005 ActiveX Step by Step

In my project, ActiveX is used in the page. After referring to many articles, many flaws are found there. It cause me to waste lots of time. Now I write down the steps in detail, hope it helpful to others.

1.New a project "class library".

2.Add a item "Component class".

3.Add your own reference related to your business.

4.Make your component realizes the interface "IObjectSafety" to make it safe to IE.

below is the path specified, you can find the corresponding code there.

http://www.pinvoke.net/default.aspx/Interfaces/IObjectSafety.html

5.Add a sign file from project setting ( *.snk ).

6. In Assembly.cs file change the related line like below:

[assembly: ComVisible(true)]

8. Finished.

 

Now you should have a ActiveX DLL file. In .Net2.0, there is a tool to deploy the ActiveX made by VS2005.

Register: regasm.exe /codebase YourFile.dll

UnRegister: regasm.exe /u YourFile.dll

 

Enjoy it, hope it helpful to you.

 

Jeffrey

 

[Reference:彬彬的工程记事本] http://blog.csdn.net/binwind/archive/2006/05/11/72...

posted on 2007-05-31 12:58  hanfey  阅读(1315)  评论(0)    收藏  举报

导航