Home > Software engineering >  Non-modal/modal dialog box to create error
Non-modal/modal dialog box to create error

Time:09-23

I create a modal dialog box in the program, error; Create a modal dialog box, normal, suggesting that the dialog itself is no problem, the problem is that to create on the way, the following code when a piece of code to create dialog

//CVibrationVisual is needed to create the dialog
M_pVibrationVisual=new CVibrationVisual;

If (m_pVibrationVisual!=NULL) {

//IDD_VIBRATONVISUAL for child dialogs ID of the
M_pVibrationVisual - & gt; Create (IDD_VIBRATONVISUAL, this);
M_pVibrationVisual - & gt; ShowWindow (SW_SHOW);
//m_pVibrationVisual - & gt; DoModal ();
HideUI ();//Dialog function in a subclass, similar to ShowWindow (SW_HIDE), hide the parent window

In creating a modal dialog box, the system errors as shown

After debugging errors also appear in the execution of
M_pVibrationVisual - & gt; Create (IDD_VIBRATONVISUAL, this)
Check the MSDN found after the Create () function parameter is not complicated, I change this to NULL is also not line, so I would like to ask you, what is the cause of this error may be?

CodePudding user response:

IDD_VIBRATONVISUAL there is something wrong with the template
Resources in the Ctrl + T try?

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:

Find out information, preliminary confirmation should be create MFC DLL issues, also in further study

CodePudding user response:

DLL to use your own template:
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

CodePudding user response:

Problem solved, plus LOAD_LOC_RES when creating the window (GetLocRes ()), thanks for your answer!

CodePudding user response:

LOAD_LOC_RES (GetLocRes ())?? MFC

CodePudding user response:

In the main class header files to add
CConnectDlg * pTD global variables
Then. CPP performed in
 pTD=new CConnectDlg (); 
PTD - & gt; Create (IDD_Connect);//create a non-modal dialog
PTD - & gt; ShowWindow (SW_SHOWNORMAL);//display a modal dialog box

I am so create a modal dialog box
  • Related