Creating COM DLL in VB.Net

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
 
M

Mattias Sjögren

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
 
W

William LaMartin

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

William LaMartin

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.
 

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