Fundamentals of Dialog Boxes - MFC

Customize the dialog and call it.

2025-10-29

Written by: xiaobin

properties

Select the dialog form, then right-click and select “properties”:

win Control

Drag the Win Control from the Toolbox to the dialog window:

invoke(SerialCommView.cpp)

In the main form’s button event.

#include "ConfigDlg.h"
CConfigDlg* dlg = new CConfigDlg(this);
dlg->DoModal();

Breaking changes

CDialogEx

The primary technique used to create a dialog is to derive a class from CDialog. To enhance it, Microsoft created a new class named CDialogEx. This class is derived from CDialog and it added only two characteristics: a color background and a picture background.