Re: Going From MFC to .NET
Christopher Benson-Manica wrote:
In comp.lang.c++ Tom Serface <tserface@msn.com> wrote:
I couldn't figure out what you mean by the comment. You said ".NET offers
such an improvement over MFC, this effort sounds like a waste of time."
What I meant is that trying to open an MFC project with .NET sounds
much less fruitful than simply rewriting the project, assuming
resources are available.
Christopher:
You are still confusing me here. The fact that MS marketing chose to add
the suffix .NET to VS2002 and VS2003 does not mean that these products
cannot compile a native (e.g. MFC) project. They can. Upgrading a VC6
project to VS2002 or 2003 (or 2005) should be a simple matter of fixing
a few parts of your code that are flagged by the stricter (better!)
compiler, and a very small number of breaking changes in MFC. No big
effort. Personally, apart from improving the code, I do not see much
advantage to this, and what I do is use VS2003 to improve my code, and
then go back to developing it in VC6, whiose IDE I much prefer.
Converting an application to use the .NET framework is a whole other
thing. Here MS has provided some ability to migrate to .NET by allowing
some mixing of MFC and Winforms. If you are going to do this I would
certainly recommend using VS2005 with its improved C++/CLI syntax. But
this route has very little appeal for me: mixing MFC and Winforms seems
to me the worst thing to do because you end up with two sets of baggage.
My current approach is to strive to move all the "business logic" of my
MFC applications into pure C++ classes that do not use MFC. Then one day
(not soon!) I will create managed wrappers for these classes using
C++/CLI, and completely rewrite the GUI, either in C++/CLI or C#.
David Wilkinson