Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2010 Creating a DLL in VS2010 and Referencing it in VB6

$
0
0
Basically I've got this huge project to convert a program in VB6 to a .net framework.

So because the program is so big, my plan is to take some of the VB6 functions in the program now and converted them to a .net DLL and then instead of the VB6 just calling a function it its module, it would call the new function in my new DLL. Over the course of a year I should have all the major functions converted over and in production and then I'll save the GUI interface for last.

However I am having a problem seeing the Members of my Class in VB6

Here is what I did to create a small test to recreate the problem I am having
  1. Created a Class Library Project in VS2010
  2. In Compile Properties of the DLL I checked to Register for COM interop
  3. I selected Sign the Assembly (with no password and gave it a nice name)
  4. I created a public function HW in the class which is also public. The function just returns Hello World ect ect. Just a sting.
  5. I built my project which created 4 files in the bin/debug directory (DLLTest.dll, DLLTest.pdb, DLLTest.tlb and DLLTest.xml)
  6. I then registered the DLL by creating a .bat file (Call C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "[MY PATH]\DLLTest.dll" /codebase /tlb:"[MY PATH]\DLLTest.tlb" and running it. With a pause on the .bat file I was able to see it registered correctly.
  7. Next I opened up a new VB6 Project and selected Standard .exe
  8. I added a reference to the DLLTest from the list. (Listed under DLLTest in the list of References)
  9. In the form load I set "Dim MyTest As New DLLTest.ClsLab (This is where my HW function is)
  10. I then typed MyTest. and nothing came up. However if I type MyTest.HW it works and returns the value I put in to test with

So my problem is how do I get the Members of ClsLab to show up in VB6?

When I reference the DLL in a VS2010 Project, they show up. But they do not show up in VB6.

Its going to be a very challenging year for me if I cannot get the members of these functions show up in VB6.

Thanks,

-Jeff

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>