Use C# data from a C++ DLL

F

Fabry

Dear all,

I do not know if this is the right group for my questions but I would
guess.

I have some DLL written in ANSI C++ for a cross platform use. For each
DLL I have a Plugin class that extend an interface tha allow me to
load the internal functionality of the DLL. Now I would like to use my
DLLs in a C# application.

The big problem is that my C++ routines have different data structure
as argument. The data structures are complex and use char, int,
double, char* and so on...

How can I wrap my plugins for the use of the data structures? There is
any trick for my purposes?

Thank you in advance for the help.

Best Regards,
Fabrizio
 
D

David Lowndes

I have some DLL written in ANSI C++ for a cross platform use. For each
DLL I have a Plugin class that extend an interface tha allow me to
load the internal functionality of the DLL. Now I would like to use my
DLLs in a C# application.

The big problem is that my C++ routines have different data structure
as argument. The data structures are complex and use char, int,
double, char* and so on...

How can I wrap my plugins for the use of the data structures? There is
any trick for my purposes?

Fabrizio,

One solution is to design an idealised C# interface to your DLL but
implement it in C++/CLI in your C++ project. You can then use C++/CLI
to interface seamlessly with your native C++ code.

Dave
 

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