unmanaged code, COM interop vs. exported C functions

K

Kevin Aubuchon

Hello,

I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.

Thanks in advance,
 
M

Michael Giagnocavo [MVP]

I don't see any advantage, but as you mention, there's all the disadvantage
(and overhead) of using COM interop.
 
D

Dmitriy Lapshin [C# / .NET MVP]

I agree with Michael - export your public functions with the WINAPI
convention and consume them from the C# client with P/Invoke.
 
W

Willy Denoyette [MVP]

If it's an existing DLL with only exported C functions, you don't have any
other option as to use PInvoke.

Willy.
 

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