我一直试图在不使用注册表的情况下从 C sharp 应用程序调用 vb6 dll。我想在使用的时候使用dll的路径。我无法创建 vb dll 类的对象。请帮忙!目前为止我写的代码如下:
Assembly assem = Assembly.LoadFile("dll path");
Type classType = assem.GetType("classname");
MethodInfo method = classType.GetMethod("show"); //My methos is called show
method.Invoke(null,null); // I have to invoke the method using class object, which I am unable to create
最佳答案
VB6 DLL 是 COM DLL。通常您会注册 DLL(在注册表中),然后从您的 .NET 项目中添加对 VB6 DLL 的引用。
这MSDN article给出了从 .Net 应用程序使用免注册 COM 的演练。
关于c# - 从 C# 调用 vb6 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9256016/