Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfxMessageBox() Question (using yes no to determine next step...

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
US
For example:

AfxMessageBox("Do you like it?", MB_YESNO)

I'm reading in MFC docs and it talks about ID_YES and ID_NO but I'm not sure how to associate these with the message box and a if else statement.

This one is easy for a seasoned programmer but I simply never used it before.

Thanks again. =====================
Insider
4 year 'on the fly' programmer
C++ Basic Java
 
The AfxMessageBox returns an int and IDYES is a constant int...

int iAnswer = 0;
iAnswer = MessageBox("Do you like it?", MB_YESNO);
if(iAnswer == IDYES)
{
DoStuff();
}else{
DoOtherStuff();
}

Good Luck!
CES
 
thank you. I even considered that but for some reason I kept using ID_YES instead of IDYES. MFC keeps refering to it by ID_YES.....


well it is working... thanks again. =====================
Insider
4 year 'on the fly' programmer
C++ Basic Java
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top