The constructor is the function that runs first when the C ++ class is created. It is mainly for the initialization of the member variables of the C ++ class object and is intrinsic. OnInitDialog is mainly aimed at the initialization of windows form controls related to class objects, which is external. It can be seen that the constructor is performed before the form is created, and the OnInitDialog is performed after the form is created. OnCreate is the message when the dialog box is created. At this time, the dialog box has not been displayed on the screen. And none of the controls in the dialog have been created. OnInitDialog () is the completion of the dialog box, that is, all the controls on the dialog box are created for the first time after the message is displayed on the screen. At this point, the controls in the dialog box can be initialized.