带有 .NET 库的 VB6
我有一个用 VB6 编写的应用程序,并且需要使用用 .NET 编写的库。有什么方法可以在我的应用程序上使用该库吗?
谢谢
I have an application written in VB6, and I need to use a library written in .NET. Is there any way to use the library on my application?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这取决于。您可以控制 .NET 库吗?
如果是这样,您可以修改您的库,以便将其注册为 COM 组件。然后您可以使用 VB6 中的 COM 组件。
您可以按照此 CodeProject 教程逐步指导如何在 .NET 中创建 COM 组件、注册它,然后从 VB6 调用它:
向 COM 公开 .NET 组件
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
请参阅如何从 Visual Basic 6.0 调用 Visual Basic .NET 或 Visual Basic 2005 程序集和 C 所有 .Net 类来自Visual Basic 6 适合初学者。
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.
您需要将 .Net 库公开给 COM...
http://support.microsoft.com/kb /817248
http://www.codeguru .com/csharp/.net/net_general/comcom/article.php/c6747
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