Re: Creating COM server with C#
- From: Leon Lambert <lambertl@xxxxxxxx>
- Date: Thu, 29 May 2008 06:39:15 -0500
m.a wrote:
"Marc Gravell" <marc.gravell@xxxxxxxxx> wrote in message news:epvwSkVwIHA.5472@xxxxxxxxxxxxxxxxxxxxxxxIt is pretty easy to expose interfaces as COM. You just need to decorate the interface and or its methods with [ComVisible(true)] following is an example interface.You cannot AFAIK write a native COM server in C#.
What you *can* do is write a "serviced component" (i.e. a COM+ dll that you can host as a COM+ application in "Component Services".
http://msdn.microsoft.com/en-us/library/ty17dz7h.aspx
Alternatively, you can use a COM-server compatible framework to write a shim COM server to the managed (.NET) COM library (dll); for quick'n'dirty jobs I've used VB6 for this; or C++ if you are literate with it (I'm not very...).
Marc
Thanks Marc,
What is the difference between COM and COM+? I want to use my COM in matlab. Can I write COM+?
Regards
[ComVisible(true)]
public interface ITypeDefinition : IDisposable
{
/// <summary>
/// Get the name of this type
/// </summary>
String TypeName{get;}
}
Once you have the assembly built you can use the regasm tool to register it.
Use help on ComVisible and regasm to find out the details. You might check www.codeproject.com for examples. I find most everything I have questions about has some sort of example there.
Hope that helps.
Leon Lambert
.
- Follow-Ups:
- Re: Creating COM server with C#
- From: Marc Gravell
- Re: Creating COM server with C#
- From: Marc Gravell
- Re: Creating COM server with C#
- References:
- Creating COM server with C#
- From: m.a
- Re: Creating COM server with C#
- From: Marc Gravell
- Re: Creating COM server with C#
- From: m.a
- Creating COM server with C#
- Prev by Date: Mouse leave for windows form which has some controls not firing as desired
- Next by Date: Re: strings question
- Previous by thread: Re: Creating COM server with C#
- Next by thread: Re: Creating COM server with C#
- Index(es):
Relevant Pages
|