aemami

I hope someone is in the same situation as me - at least to share in my misery.

At our company, we have an existing codebase that consists of about 10 projects. All of the projects are a mix of C and unmanaged C++. We are using VS2005. The projects are not set up to have any /CLR support.

What I want to do is, convert all the .C files to .CPP. Once all the files are unmanaged C++, then they should be able to interact with Managed C++ according to C++ Interop (this is the assumption I am operating under).

My question is ... how straightforward of a task is this, what issues might arise, and is it possible and/or practical

My other option is to use PInvoke to make a C# wrapper for everything, but there is a LOT of code and using PInvoke to wrap everything sounds tedious and error-prone.

Thanks



Re: Visual C++ General Porting a project from C to Unmanaged and Managed C++

crescens2k

That is one of the nice things, C++ was written to be compatible with C, so there should be very few problems arising.

Once you are past that stage, working with the CLR is easy. You can interact with C++/CLI with little more than compiling the source file with the /clr option.

You may want to read the native/managed interoperablility guide in the MSDN.

http://msdn2.microsoft.com/en-gb/library/zbz07712(VS.80).aspx