简体   繁体   English

如何在VB6中注册不用作COM互操作的.NET DLL?

[英]how to register a .net dll not being used as a com interop in vb6?

I have a .net .dll written in c# and not being used as a COM interop.I need to use this dll as a reference in vb6.I got an error while adding the refrence "Can't add a reference to the specified file"? 我有一个用C#编写的.net .dll,没有用作COM interop。我需要将此dll作为vb6中的引用。添加参考时出现错误“无法向指定文件添加引用” “?

By using command promt for registering i got an error " The module was loaded but the entry-point DllRegisterServer was not found. Make sure that it is a valid DLL or OCX file and then try again." 通过使用命令promt进行注册,我得到一个错误“模块已加载,但找不到入口点DllRegisterServer。请确保它是有效的DLL或OCX文件,然后重试。”

You cannot directly do what you are asking. 您不能直接做您要问的事情。 The only thing that VB6 can "register" is by definition a COM DLL. 根据定义,VB6唯一可以“注册”的是COM DLL。

If you are not able to modify the C# DLL to add COM interface elements, then alternatively you could write a wrapper in C# or VB (.net) which itself exposes a COM interface, and internally calls the original DLL. 如果您不能修改C#DLL来添加COM接口元素,则可以用C#或VB(.net)编写包装程序,该包装程序本身公开COM接口,并在内部调用原始DLL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM