Using a VB .NET DLL in VB 6


H

Howard Kaikow

I did the following:

1, Created a VB 6 ActiveX DLL.

2. Created a separate VB 6 project that used a function in the DLL.

3. Ran the DLL project, then added a reference to the VB 6 project that
called a function in the DLL.

4. Stopped the DLL project.

5.. Used VB .NET to upgrade the VB 6 ActiveX DLL to VB .NET 2003.

How do I debug the VB .NET DLL using the VB 6 project that references the
function in the DLL?
I do not see the running DLL project listed in the available references in
VB 6.
 
H

Howard Kaikow

I found a partial solution.

If I check the box for "Register for COM INterop" in Configuration
Properties | Build, the library gets registered.

I then need to use the following to unregister:

regasm \u x.dll /tlb:x.tlb

However, using the following does not re-register:

regasm x.dll /tlb:x.tlb
 
Ad

Advertisements

N

NetOcean

You need as u said to first Register for COM INterop" in Configuration
Properties and build the class library, then
you have to use reagasm /tlb:assembluname.tlb c:\assemblyname.dll

and then

gacutil /i c:\assemblyname.dll

i was having the same problem and it solved like this
 
H

Howard Kaikow

There's no need to put it in the GAC.

Registering the DLL for COM is sufficient to allow VB 6 to include a
reference.

Annoyingly, I can unregister the DLL using regasm, but using reagasm is not
sufficient to register the DLL unless Register for COM is selected.
 
N

NetOcean

Yes you are right i think to be used with VB 6.0 no need to register it
in GAC. But in my case i was using it in classic ASP application.

Does exporting the .Net assembly to COM using regasm method effect the
performance ?
 
Ad

Advertisements

H

Howard Kaikow

No need to register in GAC to use with VB 6.
Once the DLL Is registered by using Register for COM, the DLL shows up in
the list of available project references in VB 6 and I can unregister using

regasm /u x.dll /tlb:x.tlb
 

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