.NET and COM: The Complete Interoperability Guide

Author: Adam Nathan
3.6
This Month Stack Overflow 5

Comments

by anonymous   2019-07-21

A quick glance through the contents of ".NET and COM: The Complete Interoperability Guide" (which is based on .NET 1, but COM interop hasn't changed much) via Safari Books Online doesn't reveal anything.

Therefore I would consider creating the service part with WCF, and then create a client library that exposes a COM interface locally. (So replacing the in-process COM proxy of DCOM and COM+ with a COM -> .NET CCR and then doing everything else in pure .NET.)

The client library's COM interface can of course be registered in component services to be seen as COM+ (but unless the functionality you are providing needs some COM+ service this doesn't achieve much).

by Mike B   2019-07-21

This question is too broad. The only reasonable answer is P/Invoke, but that's kind of like saying that if you want to program for Windows you need to know the Win32 API.

Pretty much entire books have been written about P/Invoke (http://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X), and of course entire websites have been made: http://www.pinvoke.net/.

by anonymous   2019-07-21

making a c# wrapper for a c library is a complex process. I can give a few hints but strongly suggest reading up on it.

THe pinvoke bible is adam nathans book http://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X

But for a start - for opaque handles use IntPtr not object

 [DllImport("libjulia.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr jl_get_function(IntPtr m,string name);
by anonymous   2019-07-21

You have a DLL. You need to use PInvoke to call the methods in the it.

I strongly suggest you get Adam Nathans excellent book that covers pinvoke in detail http://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X

Pinvoke in tutorials is simple, in real life it can get complicated. It depends on the method signatures

by anonymous   2018-05-21
the bible on pinvoke et al is https://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X
by anonymous   2018-01-22
bible fro this is adam nathans book. https://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X
by anonymous   2018-01-07
the bible on pinvoke is adam nathans book https://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X
by anonymous   2017-09-05
Adam NAthan's book is the bible for pinvoke. https://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X