Integrating C++ recipe in a C# solution


DTsur
11-14-2003, 11:22 AM
Hi all:

I am using Visual Studio .NET to develop a solution in C#. A component of this solution is a modification of the NR xamoeba driver and amoeba routine in C++; I would like to call the amoeba routine from within C#. The C++ code compiles properly on its own i.e., as a stand-alone console application. To integrate it I tried to convert xamoeba to a DLL. The same code does not compile and produces a compilation error related to type conversion: "error C2664:'NR::amoeba': cannot convert 'DP(const Vec_I_DP &)' to 'DP(__cdecl*)(const Vec_I_DP &)' "

Has anybody experienced similar problems? does anybody know a work around? any other related feedback would be most welcome.

Dick

aurva
06-20-2007, 01:50 AM
try an online code converter for c++ to c#

GravityGuy
08-02-2009, 03:05 PM
Now that C++ can be written in a .net 'managed code' way, and also as 'unmanaged' or in an 'unsafe' code block, you should have far less trouble. This question was asked prior to these current abilities.