Windows, MFC, and .NET (a different question)

A different question concerning MS and their development environment? With the release of .NET, do Windows apps still require MFC?

I learned Windows programming through MFC, and I hate it because it’s a perversion of good C/C++ programming and non-portable. I have an app I wrote early on that I love that I’m trying to update, by replacing all the MFC based near template classes with real template classes, which I understand completely. However, the code for displaying and maintaining the window is still MFC based.

Is there a new mechanism for displaying and maintaining the window? Where can I find a tutorial, etc.?

yesnoyes…

The .NET environment includes the Windows.Forms library, which, IIRC, provides the same window management functionality as MFC but I don’t believe that it retains any code-compatibility. Microsoft publishes another library, the Windows Template Library which also replaces much of MFC’s window-handling functionality but will work with very similar client code (WTL can also produce small executables which do not require any runtime libraries, except for the MS C++ runtime (msvcr*.dll) if you choose to use it).

Of course, WTL applications will not run on other platforms (no better than MFC) and I would not classify it as modern C++ (though it is better than MFC from this perspective). If you want to write portable (*NIX, Macintosh, and Windows) applications, you’ll need to use a different toolkit and you’ll probably need to rewrite your window handling code completely (I don’t have enough familiarity with cross-platform toolkits to recommend one).