Search code examples
c#c++borland-c++

Migrating Borland C++ to C#


I have to execute project where I need to migrate Borland C++ code to C#, what are the important steps I need to follow for smooth migration of code? and please suggest any kind of Tips and Tricks?


Solution

  • That actually means a complete re-write. If I were you, I'd try C++/CLI instead of C#. This way, you can acutally gradually rewrite your code and transform it to managed code.

    Things to consider, wether you migrate to C# or C++/CLI:

    1. Partition your software in modules with clean interfaces (using n-tier architectures, MVC, ...). If each partition is a COM-object, you can even try to migrate only parts and use the COM objects in .NET.
    2. Identify the libraries you depend on and check how you can replace them in .NET
    3. Determine where you use pointers and check how you can transform this code in C++
    4. Check where you use RAII-objects and find a way to get the same result in .NET.

    I can't give you more detailed advice as I don't know what type of program you want to migrate and for what reason.