E
Eric Fortin
I'm trying to create a classlibrary in VB.net and call it from VB6.
I can't figure it out.
I created a .net project
Created a proc DoSomething
Sub DoSOmething()
msgbox ("You did something")
end sub
Then I compiled it.
I then Tried to create a reference in vb6, but got an error. (cannot load
project or library)
So then I tried
regasm ClassLibrary1.dll /tlb:ClassLibrary1.tlb
It seemed to work.
So I added the tlb to my vb6 references.
I can:
dim obj as ClassLibrary1.Class1
but when I execute:
set obj = new ClassLibrary1.Class1
I get a:
Automation error
cannot create a file when that file already exists
dim obj as object
set obj = createobject("ClassLibrary1.Class1")
produces the same error.
WHat am I doing wrong. How do I call a vb.net dll from vb6.
It works when I call the class lib from another vb.net project.
Please help!!!
I can't figure it out.
I created a .net project
Created a proc DoSomething
Sub DoSOmething()
msgbox ("You did something")
end sub
Then I compiled it.
I then Tried to create a reference in vb6, but got an error. (cannot load
project or library)
So then I tried
regasm ClassLibrary1.dll /tlb:ClassLibrary1.tlb
It seemed to work.
So I added the tlb to my vb6 references.
I can:
dim obj as ClassLibrary1.Class1
but when I execute:
set obj = new ClassLibrary1.Class1
I get a:
Automation error
cannot create a file when that file already exists
dim obj as object
set obj = createobject("ClassLibrary1.Class1")
produces the same error.
WHat am I doing wrong. How do I call a vb.net dll from vb6.
It works when I call the class lib from another vb.net project.
Please help!!!