Craig
Craig

Reputation: 1225

Exit out of a CPropertySheet Wizard

I have a C++ application that is a Wizard. During the application it detects if certain hardware is installed. If it is not, it pops up a AFXMessage that asks if the user wants to retry or quit. I have the retry part working but can not figure out to just exit out of the application. I can have it go to the finish page, but I need it to just quit the application.

The class checks for the hardware in the OnSetActiveDelayed call. If I do a QueryClose call it returns back to the base class but does not exit. Should I have it call OnQueryCancel instead?

Upvotes: 0

Views: 312

Answers (1)

Edward Clements
Edward Clements

Reputation: 5152

From MSDN Documentation:

Even though CPropertySheet is not derived from CDialog, managing a CPropertySheet object is like managing a CDialog object

To quit the wizard, just call the property sheet EndDialog() function, like

m_pPropertySheet->EndDialog(IDCANCEL);

where m_pPropertySheet is a pointer to your CPropertySheet derived class instance.

Upvotes: 1

Related Questions