开发者

Is there a utility to generate a Com Class Wrapper from a non com .NET DLL?

开发者 https://www.devze.com 2023-02-25 03:10 出处:网络
I have a 3rd party DLL that needs to be called as COM.It is not COM, but it is a .NET DLL.Are there any utilities that will auto generate a CCW for it?Rather than making on开发者_JAVA百科e by hand?Vis

I have a 3rd party DLL that needs to be called as COM. It is not COM, but it is a .NET DLL. Are there any utilities that will auto generate a CCW for it? Rather than making on开发者_JAVA百科e by hand?


Visual Studio includes a program called "tlbexp", the Type Library exporter. This takes a .NET assembly and generates a COM type library out of it, which you can then import into a COM-based development tool like VB6. You can also use the "regasm" tool on your assembly, which will export a type library and automatically register it on the machine.

All of this assumes that the third-party .NET DLL was written with COM in mind; the types need to be COM-visible for the exporter to pick them up. Also, unless the assembly contains the interop attributes to control the typelib generation, you're gonna get some pretty rough-looking COM types (and really long ProgIds), but they should still work :)

0

精彩评论

暂无评论...
验证码 换一张
取 消