Home > Software engineering >  MFC program in VS debug mode, CPropertySheet attribute wizard abnormal? Pray god to see
MFC program in VS debug mode, CPropertySheet attribute wizard abnormal? Pray god to see

Time:09-25

In VS debug mode, inherited from the CPropertySheet wizard dialog box, click on the button in the properties page, abnormal may write:
Property page to add the source code is as follows:
IMPLEMENT_DYNAMIC (CSuperMaintenance CPropertySheet)

CSuperMaintenance: : CSuperMaintenance (UINT nIDCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (nIDCaption pParentWnd, iSelectPage)
{
The AddPage (& amp; M_SuperICcard);
The AddPage (& amp; M_SuperStart);
}

CSuperMaintenance: : CSuperMaintenance (LPCTSTR pszCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (pszCaption pParentWnd, iSelectPage)
{
The AddPage (& amp; M_SuperICcard);
The AddPage (& amp; M_SuperStart);
}

CSuperMaintenance: : ~ CSuperMaintenance ()
{
}

The button button response function is as follows:
ShowOperInfo (1, "super maintenance - start", 0, 0).
CSuperMaintenance sheet (_T (" "));
Sheet. SetWizardMode ();
Int iRet=sheet. DoModal ();
ShowOperInfo (1, "super maintenance - end", 0, 0).

The abnormal place

Debugging, in the sheet. DoModal (); The above sentence appeared abnormal, really don't understand what is abnormal, and only in the property page wizard, common dialog DoModal is not it?

CodePudding user response:

The
refer to the original poster linyimian7539 response:
in VS debug mode, inherited from CPropertySheet wizard dialog box, click on the button in the properties page, abnormal may write:
Property page to add the source code is as follows:
IMPLEMENT_DYNAMIC (CSuperMaintenance CPropertySheet)

CSuperMaintenance: : CSuperMaintenance (UINT nIDCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (nIDCaption pParentWnd, iSelectPage)
{
The AddPage (& amp; M_SuperICcard);
The AddPage (& amp; M_SuperStart);
}

CSuperMaintenance: : CSuperMaintenance (LPCTSTR pszCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet (pszCaption pParentWnd, iSelectPage)
{
The AddPage (& amp; M_SuperICcard);
The AddPage (& amp; M_SuperStart);
}

CSuperMaintenance: : ~ CSuperMaintenance ()
{
}

The button button response function is as follows:
ShowOperInfo (1, "super maintenance - start", 0, 0).
CSuperMaintenance sheet (_T (" "));
Sheet. SetWizardMode ();
Int iRet=sheet. DoModal ();
ShowOperInfo (1, "super maintenance - end", 0, 0).

The abnormal place

Debugging, in the sheet. DoModal (); The above sentence appeared abnormal, really don't understand what is abnormal, and only in the property page wizard, common dialog DoModal is not it?

The abnormal place is OnWndMsg function

CodePudding user response:

Anyone, take a look, and no might have been caused by my program somewhere else?

CodePudding user response:

Click the interrupt, posted on the call stack

CodePudding user response:

reference zgl7903 reply: 3/f
click interrupt, posted on the call stack to see

CodePudding user response:

reference zgl7903 reply: 3/f
click interrupt, posted on the call stack to see

If debug again, do not open the exception, is can run, can also function, where the output is printed may write is unusual, I feel the attributes of the wizard code is no problem, because have been used so, but when debugging debugging to DoModal () function when appears the question, can understand

CodePudding user response:

reference zgl7903 reply: 3/f
click interrupt, posted on the call stack to see

Into the DoModal () function, debugging to this place in the abnormal

CodePudding user response:

Why DoModal? How to switch the page DoModal is blocked?
Dialog initialization example:
 
CRect sheetRect;
GetWindowRect (sheetRect);
SheetRect. Top +=40;
SheetRect. Bottom -=80;

M_msgSheet=new CPropertySheet;
M_page2=new CPag2;
M_page2 - & gt; The Construct (CPag2: : IDD);
//m_page2 - & gt; The Construct (IDD_PROPPAGE_SMALL);
M_msgSheet - & gt; The AddPage (m_page2);
M_page3=new CPage3;
M_page3 - & gt; The Construct (IDD_PROPPAGE_MEDIUM);
M_msgSheet - & gt; The AddPage (m_page3);

if(! M_msgSheet - & gt; Create (this, WS_CHILD | WS_BORDER | WS_VISIBLE))
{
DWORD err=GetLastError ();
CString str;
STR. The Format (" % d ", err);
MessageBox (STR);
}
The else
{
//m_msgSheet - & gt; ModifyStyle (0, WS_TABSTOP);//no effect?
//WS_EX_CONTROLPARENT Allows the user to navigate
//among the child Windows of the window by using the TAB key.
//you will see "mainDlgButton1" in any page!
M_msgSheet - & gt; ModifyStyleEx (0, WS_EX_CONTROLPARENT);
M_msgSheet - & gt; SheetRect MoveWindow (sheetRect. Left, top, sheetRect. The Width (), sheetRect. Height ());
//m_msgSheet - & gt; GetDlgItem (IDCANCEL) - & gt; ShowWindow (SW_HIDE);
//m_msgSheet - & gt; GetDlgItem (ID_APPLY_NOW) - & gt; ShowWindow (SW_HIDE);
TC_ITEM tc.
Tc mask=TCIF_TEXT;
Tc pszText=_T (" success ");
M_msgSheet - & gt; GetTabControl () - & gt; SetItem (0, & amp; Tc);
}

  • Related