VB6 with a .NET Library
I have an application written in VB6, and I need to use a library written in .NET. Is the开发者_运维知识库re any way to use the library on my application?
Thanks
It depends. Do you have control over the .NET library?
If so, you can modify your library so that it can be registered as a COM component. You can then utilize the COM component from VB6.
You can follow this CodeProject tutorial for step by step directions on creating a COM component in .NET, registering it, and then calling it from VB6:
Exposing .NET Components to COM
See How to call a Visual Basic .NET or Visual Basic 2005 assembly from Visual Basic 6.0 and Calling .Net Classes from Visual Basic 6 for starters.
You need to expose the .Net library to COM...
http://support.microsoft.com/kb/817248
http://www.codeguru.com/csharp/.net/net_general/comcom/article.php/c6747
精彩评论