m.a wrote:
"Marc Gravell" <ma**********@gmail.comwrote in message
news:ep**************@TK2MSFTNGP06.phx.gbl...
>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
It 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.
[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