As long as you add an AFXInitricHeDit () function in the program's App Function InitInstance () function, you can display the file correctly. PS: This problem is annoyed. For ListBox, it is not possible to initialize it when adding controls, then in the BOOL OnInitDialog () function of the DLG file, initialization: Clistbox * PLB = (CListbox * Getdlgitem (IDC_DEPT); PLB-> InsertString (-1, "documentation"); plb-> insertstring (-1, "acountting"); plb-> insertstring (-1, "human rat"); plb-> INSERTSTRING (-1, "security");
CDIALOG :: ONINITDIALOG (); Do not: cdialog :: oninitdialog (); This function can only call once ~~~ Note: Mastering the learning method of the control, first understand the functions she owns, and know what she corresponds to . Take a look at the usage of others. For example, there is a very useful time when there is a message in Edit Box.