void ShowDlg (void)//display dialog
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());
CtestDlg CDLG;//definition used to test the dialog
Int b=CDLG. DoModal ();//normal display dialog
Driver DLG.//dialog variables (Driver is my own definition dialog class name)
//AfxEnableControlContainer ();
Int a=0;
A=DLG. DoModal ();//dialog box does not display the
}
CtestDlg is my new test dialog 1, can display the
normalDriver, I formally to use dialog, one loaded OCX controls, cannot show
After debugging, I found the difference between the two is test dialog 1 in CDLG. DoModal will call DoDataExchange function (), and the load control dialog 2 won't call, it should also be the cause of the latter can not display properly, is this why?
CodePudding user response:
Your Dll call AfxOleInit (); Class yet? InitInstance function calls, such as the App AfxOleInit ();CodePudding user response:
Checked the online, others said in the engineering of InitInstance () function to add AfxEnableControlContainer (), I had been added, but the execution of DLG. DoModal (); When meltCodePudding user response: