Interoperation with C++

T

Tony Johansson

Hi!

This is not an actual problem but only an example.
Assume you have an .NET assembly and you want to use some useful function in
a dll where the language has been C++.
Is it then nessessary that this C++ dll is a COM dll or DCOM dll.?

//Tony
 
A

Arne Vajhøj

This is not an actual problem but only an example.
Assume you have an .NET assembly and you want to use some useful function in
a dll where the language has been C++.
Is it then nessessary that this C++ dll is a COM dll or DCOM dll.?

No.

There are multiple ways of utilizing a native DLL (C++) from .NET code:
1) if it is a COM DLL then it can used directly, because .NET and COM
can handle all the details of interaction
2) if it is a Win32 DLL which exposes a C API then it can be
accessed via DllImport similar to how many Windows functions are
called
3) if it is a Win32 DLL which exposes a C++ API then you can write
a mixed mode C++ DLL that exposes a .NET API but delegate to the
native C++ API

Arne
 

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