Using a VB .NET DLL in VB 6

  • Thread starter Thread starter Howard Kaikow
  • Start date Start date
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.
 
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
 
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
 
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.
 
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 ?
 
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
 
Back
Top