COM Component

P

Plantex

Hello,

I have a DLL, created by VS .Net and written in C#.
I would like to create a COM component from this dll, 'cause I'd like
to call this component from a MSMQ Trigger...

How could I create create this COM component from the DLL?

Thank you

Plantex
 
M

mYsZa

Plantex said:
I have a DLL, created by VS .Net and written in C#.
I would like to create a COM component from this dll, 'cause I'd like
to call this component from a MSMQ Trigger...
How could I create create this COM component from the DLL?

Hi!
All classes defined as public in .NET are visible to COM by default. You may
change this
using ComVisibleAttribute.
To make the component visible by the COM clients you have to register it
using regasm tool.
This adds some entries to the windows registry and makes your component
visible as a COM.
To have an ability to use the component from non managed code (e.g. C++),
you need to create
a type library from your class library using tlbexp tool.
Then after importing the type library to unmanaged code usign the #import
directive you may
freely use the library as it is a COM library.

hope this helps
 

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