Hi,

I have been using the windows API for some time now and feel quite comfortable with it. I know for larger projects MFC is a better choice over the raw API. I've been google searching for some good tutorials on MFC but haven't really found any good ones like I found with the windows API (Johnnie's Tutorial).

If someone could point me in the right direction I'd greatly appreciate it.

Mitch

Dani AI

Generated

For a Win32-savvy programmer like , MFC is best approached as a structured C++ layer over the Win32 API that codifies common patterns (Document/View, message routing, resource-driven UIs) rather than hiding Win32. 's pointer to the classic tutorial is the usual entry; 's suggestion to consider managed UI toolkits and 's point about decompilation are both valid factors when choosing between native MFC and .NET.

Recommended primer: enable the Visual Studio "Desktop development with C++" workload with MFC, then create an MFC project with the AppWizard (dialog-based, SDI, or MDI). Inspect the generated code to learn the roles of CWinApp, CMainFrame/CFrameWnd, CDocument and CView, the message-map macros (BEGIN_MESSAGE_MAP/END_MESSAGE_MAP, ON_COMMAND), and dialog DDX/DDV (DoDataExchange). Practical exercises that build real understanding include a dialog with controls and validation, a simple drawing SDI that implements OnDraw and CDocument serialization, and a tiny custom control by subclassing CWnd. Use the debugger to trace message routing from WinMain/InitInstance through message maps.

Common pitfalls and modern tips: always restore GDI objects selected into a DC; clarify ownership of heap allocations (wrap with smart pointers where appropriate); handle Unicode vs ANSI carefully when moving older samples to modern toolchains; and prefer RAII wrappers for MFC resources in new code. Up-to-date reference material and sample projects are available from the official MFC documentation on Microsoft Learn: MFC on Microsoft Learn.

Recommended Answers

All 3 Replies

Member Avatar for Member #46692

Hi,

I have been using the windows API for some time now and feel quite comfortable with it. I know for larger projects MFC is a better choice over the raw API. I've been google searching for some good tutorials on MFC but haven't really found any good ones like I found with the windows API (Johnnie's Tutorial).

If someone could point me in the right direction I'd greatly appreciate it.

Mitch

Or better still get accustomed to the dot net framework, and learn c#. You can make quick GUIs wicked fast.

Or better still get accustomed to the dot net framework, and learn c#. You can make quick GUIs wicked fast.

C# is decompilable, so it isn't really usefull for bigger projects, unless it's open-source anyway.

I have absolutely no clue about MFC tutorials, so I can't help you, sorry

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.