加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

从c#调用vb6 dll

发布时间:2020-12-15 08:39:11 所属栏目:百科 来源:网络整理
导读:我一直试图从C sharp应用程序调用vb6 dll,而不使用注册表.我想在使用它时使用dll的路径.我无法创建vb dll类的对象.请帮忙!我到目前为止编写的代码如下: Assembly assem = Assembly.LoadFile("dll path");Type classType = assem.GetType("classname");Meth
我一直试图从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的演练.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读