问题描述
我创建了一个vb.net类库。它是存储设备的接口。它提供了一些对象和方法以便将数据读取和写入设备。
问题是客户有一个vb6应用程序,我们要在其中添加以下功能:类库以操纵设备。我将类更改为com类,选中了com interopt复选框,并使用.net framework 2.0 regasm.exe注册了该库。
我添加了该库作为对a的引用空白的vb6项目,并创建了一个对象。 / pre>
当我添加以下对象时,该对象等于无
$ b
t =新comlib.obj
或
t = createobject( comlib.obj)
我遇到以下错误:
我在做什么错了?
仅将变量变暗并不会为其分配值(与.NET private TypeName variableName;
相同),首先使用 Set T = New Comlib.Obj
创建它。
错误,您需要使用标准的调试技术来缩小范围,或者发布完整的错误消息,然后有人可以提供建议。
I have created a vb.net class library. It is an interface for a storage device. It gives some objects and methods in order to read and write data to the device.
The problem is that a customer has a vb6 application where we want to add the functionality of the class library in order to manipulate the device. i have changed the classes to com classes, checked the com interopt checkbox and registered the library with .net framework 2.0 regasm.exe.
I added the library as reference to a blank vb6 project and created an object.
dim t as comlib.obj
the object was equal to 'nothing'
when I added:
t = new comlib.obj
or
t = createobject("comlib.obj")
I got the following error:
what am I doing wrong?
Just dimming a variable doesn't assign it a value (the same as a .NET private TypeName variableName;
), you need to create it first using Set T = New Comlib.Obj
.
If you get an error from this, you need to use standard debugging techniques to narrow it down, or maybe post your full error message and someone can advise.
这篇关于将vb.net类库导入到vb6项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!