Creating COM DLL in VB.Net

  • Thread starter Thread starter William LaMartin
  • Start date Start date
W

William LaMartin

I am following the instructions at the link below to create a COM object.
But something is wrong since I cannot register the resulting DLL via
regsvr32 or add a reference to it from VB 6. I receive an error message
that the DLLRegistryServer entry point was not found when using regsvr32,
for example.

To simplify things, my test only had a public function that added two
integers and returned the sum. Creating a Vb.Net dll to do this works
fine. But the COM version does not.

Can someone add to what is at the link to put me on the correct path.

Thanks


http://msdn.microsoft.com/library/d...roughCreatingCOMObjectsWithVisualBasicNET.asp
 
William,
But something is wrong since I cannot register the resulting DLL via
regsvr32 or add a reference to it from VB 6.

Regsvr32 is the wrong tool to use. Assemblies are registered with COM
using the Regasm.exe tool (or a setup package). Regasm can also
generate a typelib that you can reference from VB6.


Mattias
 
Thanks. I also found that TlbExp.exe will generate the typelib that I can
reference.
 
Thanks,

Using RegAsm.exe and tlbexp.exe I was able to register the dll and then set
a reference to the tbl file in a VB6 project. And the program used the DLL
successfully.
 
Back
Top