OK, here I go again on the mixed language stuff.
I continue to be impressed by the capabilities of DOT NET. This time, it's in the realm of salvaging legacy code.
This included graphic shows a project I've been working on this week where I needed to leverage a lot of legacy MFC code. Originally, I was just going to write this in C# as I do most new projects, but needing to rewrite some of the classes I had previously written (using MFC) in another project made me come to my senses.
If I wrote the new app in C++/CLI, I would not need to rewrite the MFC-flavored classes. I had already started a couple of classes in C#, however. There are many things easier done in C#, I'll admit.
What to do? What to do?
Remembering a previous project where I combined MFC, CLI and Web Services, I called upon that same technique to also include the previously coded C# classes.
If the project type is C++ (DOT NET), the project will understand all DOT NET namespaces and assemblies as well as C/C++ header files. It'll even hande the linking. TOO COOL!
The technique is just to add everything as a project to the "Solution", set the dependencies, the references, the namespaces and the header includes and THAT'S IT! (...sounds like a lot, but it's not)
The question I have for the DOT NET community is WHY IS THERE NOT MUCH TALK ABOUT C++ anymore?
posted @ Friday, June 06, 2008 6:17 AM