How about the CPropertyPage OnOK ? [modified]
-
Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.
class CTestView;
void CTestView::OnShowDlgA()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgA"));
CTestDlgA dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
void CTestView::OnShowDlgB()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgB"));
CTestDlgB dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
class CTestDlgA : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgA ::OnOK()
{
// when is false,it will return ,and then end the dialog.
// I don't want it closed.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
class CTestDlgB : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgB ::OnOK()
{
// usually, this dialogB doesn't closed when is false.
// but the dialogA is closed at this.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !
modified on Wednesday, May 11, 2011 3:34 AM
-
Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.
class CTestView;
void CTestView::OnShowDlgA()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgA"));
CTestDlgA dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
void CTestView::OnShowDlgB()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgB"));
CTestDlgB dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
class CTestDlgA : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgA ::OnOK()
{
// when is false,it will return ,and then end the dialog.
// I don't want it closed.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
class CTestDlgB : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgB ::OnOK()
{
// usually, this dialogB doesn't closed when is false.
// but the dialogA is closed at this.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !
modified on Wednesday, May 11, 2011 3:34 AM
-
Please edit your message and add <pre></pre> tags around your code so it is readable.
The best things in life are not things.
:-D
-
Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.
class CTestView;
void CTestView::OnShowDlgA()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgA"));
CTestDlgA dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
void CTestView::OnShowDlgB()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgB"));
CTestDlgB dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
class CTestDlgA : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgA ::OnOK()
{
// when is false,it will return ,and then end the dialog.
// I don't want it closed.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
class CTestDlgB : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgB ::OnOK()
{
// usually, this dialogB doesn't closed when is false.
// but the dialogA is closed at this.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !
modified on Wednesday, May 11, 2011 3:34 AM
What is the question?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.
class CTestView;
void CTestView::OnShowDlgA()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgA"));
CTestDlgA dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
void CTestView::OnShowDlgB()
{
// TODO: Add your command handler code here
CPropertySheet sheet(_T("TestDlgB"));
CTestDlgB dlg;sheet.AddPage(&dlg); if(IDOK == sheet.DoModal()) { // do something. }
}
class CTestDlgA : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgA ::OnOK()
{
// when is false,it will return ,and then end the dialog.
// I don't want it closed.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
class CTestDlgB : public CPropertyPage
{
// ...
}// add the virtual function
void CTestDlgB ::OnOK()
{
// usually, this dialogB doesn't closed when is false.
// but the dialogA is closed at this.
if( !SaveParams() )
return;EndDialog(IDOK); //CPropertyPage::OnOK();
}
Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !
modified on Wednesday, May 11, 2011 3:34 AM
Koma Wang wrote:
Why will appear this kind of circumstance?
This makes no sense. :confused: Please explain.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather