[C++ – MFC] Communicating with Windows

All about Windows Applications are handling various events. When you click the mouse or press a keyboard, Windows sends a message to the application and it’s up to you how to respond to this. MFC helps you a lot. It informs you that  what kind of actions a user has been done such as a button is clicked.

Because of the structure of C++, the message handling code uses a lot of macros and this usage usually makes developers confused. Therefore, it is very important to understand the structure of message handlers in MFC.   Continue reading

[C++ – MFC] How MFC Works (1) – SDI

MFC (Microsoft Foundation Classes) is a library, mainly for GUI. But the MFC is more than that. It might be more correct to say that MFC is a host system for MFC applications. Therefore it is crucial to understand how MFC organizes application objects(views, documents, and frame windows) in your solution. Let’s find out how MFC works using a simple SDI application.

In this post I am going to create a simple text editor (MiniNotePad).   Continue reading

[C++ – MFC] Structure – App/Document/View

MFC(Microsoft Foundation Classes) is a class library for building GUI (Graphical User Interface) on Windows operating systems.

MFC actually a wrapper of Windows APIs in an object-oriented way. MFC follows the concept of the famous MVC pattern, maybe roughly. It has documents (data), views, and a document template (controller). But by allowing handling events in a view, MFC code becomes quite complex. If you develop a new GUI application, I recommend you to use CLI (.NET) applications. MFC should be restricted just for legacy applications.   Continue reading