.NET and unmanaged C++ communication

D

dydrmr

Hi,

I am developing a ASP.NET application which uses a 3rd party API that
is an unmanaged C++ DLL. The possible solutions that I have in mind to
build the .NET to C++ bridge:

1. Import the unmanaged C++ DLL in the .NET (C#) program and call the
functions as static entry points exposed by the DLL. This would be very
cumbersome as it wont let the .NET app have a Object Oriented design.
2. Build a COM wrapper using C++ around the unmanaged DLL and import
these COM components in the .NET project as a reference. There's still
an issue of converting C++ standard and custom data types to sth that
..NET understands. .NET interop would sure help marshalling standard
datatypes(string, int, char etc..) but what about the custom datatypes?

3. Code the .NET application in C++ and use the C++ API directly (or
through a COM layer as in point 2 above).

Personally I think approach 2 should be the best in terms of
application extensibility and maintainability.

Any pointers regarding this would be helpful.

Thanks
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top