Reputation: 18201
I have MFC
dialog form with OK/Cancel
buttons. After pressing these buttons form is closed and I have modal result IDOK/IDCANCE
L. Now I would like to have buttons that would close form in the same way and return IDYES/IDNO
in modal result. How to do that?
Upvotes: 1
Views: 1005
Reputation: 12247
A dialog provides OnOk() and OnCancel() functionality but not OnYes() or OnNo(). You simply add buttons to implement that yourself and since IDYES and IDNO are defined by MFC you can just call the following:
EndDialog( IDYES ); // when yes is pressed
EndDialog( IDNO ); // when no is pressed
Upvotes: 3