C++ and C#

M

mshetty

Hi,

We have some common functionality that has to run with both C++ and C#.
What would be the best way to design this.

One of the approaches we could think of is to
1. create an exe for the common code
2. create api's in C++ and C# to invoke this exe
3. Put the api's in a library each for C# and C++

Would help if we could get some alternatives to do this.

Thanks and Regards,
M Shetty
 
T

tragomaskhalos

Hi,

We have some common functionality that has to run with both C++ and C#.
What would be the best way to design this.

One of the approaches we could think of is to
1. create an exe for the common code
2. create api's in C++ and C# to invoke this exe
3. Put the api's in a library each for C# and C++

Not sure I understand enough about your problem, but I think your
separate exe solution is poor. Why not do this:
- write core functionality in standard C++ and build into a library.
- write wrapper layer in C++/CLI and either link to the above library
or recompile above source as managed code, to form a .NET assembly.
The former can be linked into a standard C++ program, and the latter is
a .NET assembly which can be called from C#, VB.NET etc etc.
 

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
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top