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

**URL:** <https://boards.straightdope.com/t/windows-mfc-and-net-a-different-question/232111>\
**Category:** Factual Questions\
**Created:** [March 2, 2004, 3:12pm UTC](https://boards.straightdope.com/t/windows-mfc-and-net-a-different-question/232111 "2004-03-02T15:12:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VunderBob](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@VunderBob](https://boards.straightdope.com/u/VunderBob)\
**Post date:** [March 2, 2004, 3:12pm UTC](https://boards.straightdope.com/t/windows-mfc-and-net-a-different-question/232111/1 "2004-03-02T15:12:33Z")

</div>

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.?

---

<div class="post-metadata">

**Author:** ![np\_complete](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@np\_complete](https://boards.straightdope.com/u/np_complete)\
**Post date:** [March 2, 2004, 4:25pm UTC](https://boards.straightdope.com/t/windows-mfc-and-net-a-different-question/232111/2 "2004-03-02T16:25:51Z")

</div>

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](http://www.microsoft.com/downloads/details.aspx?FamilyID=128e26ee-2112-4cf7-b28e-7727d9a1f288&displaylang=en) 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).
