Is it possible to use C++ code in C#?

  • Thread starter Thread starter Nick
  • Start date Start date
Nick,

No, it is not. The only way you could do it is through COM Interop, the
P/Invoke layer, or by creating a managed wrapper.

Hope this helps.
 
Hi,

In fact, I have some codes orginally written using C++/ATL, my concern
is to port the code into a C# project.

For the choices you adviced, which is the most easiest method of doing this?

Thanks.
 
Ricky,

Why port it? If you have it written in using C++ and ATL, then I assume
it is a COM object? If it works, why spend the money to port it? I would
just use COM interop, setting a reference to the COM object in my .NET
project.
 
Back
Top