COM + .NET
Hi guys!
I'm using .NET to code a Windows Service. Problem is, I must insert some COM (yeah, Component Object Model) code into it so I can connect to a cluster using Windows Compute Cluster API.
Is mixing COM and .NET possible? Are there advantages/disadvantages to this approach? I think it may not be possible since .NET uses the JIT compiler and COM doesn't, so...tough doubt.
Mixing COM and .NET are most certainly possible; in fact you can think of .NET as "COM 2.0".
Do you need to consume COM objects, provide COM objects or handle COM events? The specifics of the interop vary. I've consumed and provided COM objects and its fairly easy; I've not done something that handles COM events (i.e. the callback mechanism in COM).
Take a look at the ComVisible attribute in the framework.
Oh, and the fact that .NET is JIT compiled has no bearing on the issue. You can expose and consume COM objects from vbscript and its interpreted.
Do you need to consume COM objects, provide COM objects or handle COM events? The specifics of the interop vary. I've consumed and provided COM objects and its fairly easy; I've not done something that handles COM events (i.e. the callback mechanism in COM).
Take a look at the ComVisible attribute in the framework.
Oh, and the fact that .NET is JIT compiled has no bearing on the issue. You can expose and consume COM objects from vbscript and its interpreted.
Here are two articles which help illustrate how you can use COM from within .NET.
".NET Interop: Get Ready for Microsoft .NET by Using Wrappers to Interact with COM-based Applications"
http://msdn.microsoft.com/msdnmag/issues/01/08/interop/
"Understanding Classic COM Interoperability With .NET Applications"
http://www.codeproject.com/dotnet/cominterop.asp
Cheers!
".NET Interop: Get Ready for Microsoft .NET by Using Wrappers to Interact with COM-based Applications"
http://msdn.microsoft.com/msdnmag/issues/01/08/interop/
"Understanding Classic COM Interoperability With .NET Applications"
http://www.codeproject.com/dotnet/cominterop.asp
Cheers!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement