Help: VB6 & VB.net

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!!!
 
E

Eric Fortin

This is still giving me an error:

The first time and after every reboot:

when I do the Set p = new Person

This the error information
?err.Description
Automation error
Cannot create a file when that file already exists.
?err.Number
-2147024713
?err.Source
MyComLib
 
E

Eric Fortin

I forgot to include the first error:

TItle:
vb6.exe MSCOREE.DLL load error(error code = %X)

Two different copies of MSCOREE.dll have been loaded.

First Copy
<Unknown>

Second Copy
C:\windows\microsoft.net\framework\v1.1.4322\mscorwks.dll

THis is typically caused by having a registered MSCOREE.dll that is
different from the one that is statically linked with the application.
 
E

EP

I also get this error during an .msi installation.

Does anyone know what causes this?


Eric Fortin said:
I forgot to include the first error:

TItle:
vb6.exe MSCOREE.DLL load error(error code = %X)

Two different copies of MSCOREE.dll have been loaded.

First Copy
<Unknown>

Second Copy
C:\windows\microsoft.net\framework\v1.1.4322\mscorwks.dll

THis is typically caused by having a registered MSCOREE.dll that is
different from the one that is statically linked with the application.



<http://mvps.org/dotnet/dotnet/samples/codingtechnique/downloads/MyComLib.zi
 
G

Guest

I got this same error after installing Installshield DevStudio 9. It happens when I try to load a form. I have Enterpries Architect installed. Another machine we have has VS Pro and does not have the problem. I uninstalled IS and the error went away. I still don't know what is going on though

----- EP wrote: ----

I also get this error during an .msi installation

Does anyone know what causes this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top