Connecting Tech Pros Worldwide Forums | Help | Site Map

C++ and C#

mshetty@mail.com
Guest
 
Posts: n/a
#1: Sep 29 '06
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


tragomaskhalos
Guest
 
Posts: n/a
#2: Sep 29 '06

re: C++ and C#



mshetty@mail.com wrote:
Quote:
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.

Closed Thread