Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 920229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:40:42+00:00 2026-05-15T18:40:42+00:00

Currently, we are working on a C++ legacy code base, which consists of several

  • 0

Currently, we are working on a C++ legacy code base, which consists of several software components.

One of the components, are written in a way that is extremely difficult to maintain. (For example, memory allocation is done in X place, but memory de-allocation is done in Y place. This make memory management a painful job). Till now, we able to solve (or workaround) all the memory leakage issues.

However, after several rounds of bug fixing, our feeling is that, due to the high maintenance cost of this software component, we are unable to go too far from current milestone.

I know it might be bad to rewrite the source code : http://www.joelonsoftware.com/articles/fog0000000069.html

However, instead of re-factor the current code, we forsee it will be better to re-write from scratch due to

  • Till now, no one in the team can fully understand that software component code.
  • The legacy software component is a small piece of software. 20k lines, I guess
  • Our teams are pretty clear on the requirement and what we are trying to achieve

Hence, we are planning to go for a managed code, at least make memory management a painless job. We plan to choose C#, as

  • All our C++ code are compiled using Microsoft VC++
  • We are using MFC, in other software components. (in DLL form) Every DLL, do have their very own resource.

I am from C++ and Java background, and know nothing much on C#.

  1. How well C# to interface with MFC DLL, with some of the DLL functions will invoke MFC GUI?
  2. Anything I need to pay attention on it?
  3. Will the interfacing with legacy C++ DLLs be easier, if we are using Managed C++?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:40:43+00:00Added an answer on May 15, 2026 at 6:40 pm

    I am in a similar situation and I also did some experiments mixing C++ and C#. The problems in my application however were that:

    • the application is not clearly split up in different modules, making it hard to move specific modules from C++ to C#
    • the application is quite cpu-intensive and experiments revealed a big overhead in calls from C++ to C# or C# to C++

    Additionally, you cannot call C# directly from native/unmanaged C++, which meant that I had to introduce an additional intermediate C++/CLI (or is this called C++.Net?) layer.

    Therefore, I chose not to move to C#, but stay with C++.

    So, if you want to move from C++ to C#, make sure:

    • that you have clearly separated modules
    • that the transition (calls) from C++ to C# or vice versa are in a place that is not used that often (so not during cpu-intensive tasks)

    Additionally, remember that if you are not the sole developer of the project, that all (or most) of your developers should also learn C#. You don’t want to delegate all C# code to your latest junior developer, because if he leaves, you will be (or could be) in trouble.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a (legacy) programme that has been written in C++
Let's say you are working on a piece of legacy code that was written
I am working on a software development project that uses code written primarily in
I'm currently working on a performance critical application which incorporates legacy c code (a
I'm working updating some legacy code that does not properly handle user input. The
Currently I am working on a legacy web page that uses a ton of
I'm working on a section of code that has many possible failure points which
I'm working with a legacy piece of code in some stuff for work which
I'm working on some legacy code that uses win32 WriteFile() to write to a
I'm working on a very large, data-intensive legacy application. Both the code base &

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.