Easiest way to make .NET DLL visible to COM?

喜你入骨 提交于 2019-12-11 11:01:27

问题


I have a proprietary .NET DLL which I would like to use in a COM client.

Currently when I use regasm it says: warning RA0000 : No types were registered

Since I don't have the source code I can't set the classes to ComVisible or whatever else is required.

How can I easily make this DLL visible to COM?


回答1:


You need to write a "COM callable wrapper". Here are a few links:

http://msdn.microsoft.com/en-us/library/ms973802.aspx

http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx

http://edn.embarcadero.com/article/32754

Some of these are quite old, but I imagine the principles have remained the same.

Edit: someone seems to have written a generic wrapper:

http://www.codeproject.com/Articles/113720/Universal-COM-Callable-Wrapper



来源:https://stackoverflow.com/questions/14471201/easiest-way-to-make-net-dll-visible-to-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!