Register .Net Components for COM

G

Guest

Hi,
I have created a simple managed component in vb.Net with a public class
exposing a public function. I successfully registered it using 'Regasm.exe'
.. But
when I tired to access it in vb 6.0( using late binding) it gives an error .
I cannot view managed component in Ole View .
Both managed componet and vb 6.0 exe are in the same folder.
How Can I successfully register my component for COM?

Thanks
 
P

Phill. W

Mihiri said:
I have created a simple managed component in vb.Net with a
public class exposing a public function. I successfully registered it
using 'Regasm.exe'.
I cannot view managed component in Ole View .

Try using the TypeLib (tlb) created by regasm instead.
Both managed componet and vb 6.0 exe are in the same folder.

Irrelevant - COM always finds components via the location held in
the Registry.

HTH,
Phill W.
 
H

Herfried K. Wagner [MVP]

Mihiri said:
I have created a simple managed component in vb.Net with a public class
exposing a public function. I successfully registered it using
'Regasm.exe'
. But
when I tired to access it in vb 6.0( using late binding) it gives an error
.
I cannot view managed component in Ole View .

Make sure you reference the type library file (".tlb") instead of the DLL.
 
G

Guest

You cannot view the DLL in OLE View because it is just an assembly not a COM
DLL. It is better to create your class as a COM class in the IDE and set the
COM Interop option for the project you are compiling. Making your class a
COM class in the IDE will automatically add the class attributes to assign
GUIDs to the interfaces. Otherwise, you'll get new GUIDS all of the time. A
COM type library will not be generated unless you set COM Interop for the
project. If you do all this you can use RegAsm to register and unregister
the assembly on other machines.
 

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