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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with switch/ case

Status
Not open for further replies.

crach

ISP
May 12, 2002
9
0
0
EE
well,i did a code like this:

void CProgramDlg::Onperform()
{
int iResult;
iResult = MessageBox("Chooce Yes or No", "question",
MB_YESNO | MB_ICONINFORMATION );
switch(iResult)
{
case MB_NO:
MessageBox("You have choocen no", "no way", MB_OK | MB_ICONINFORMATION);
break;
case MB_YES:
MessageBox("You have choochen yes", "yeees", MB_OK | MB_ICONINFORMATION);
break;

}

}


but it's giving errors like this:

error C2065: 'MB_NO' : undeclared identifier
error C2065: 'MB_YES' : undeclared identifier
error C2051: case expression not constant
error C2051: case expression not constant

i can't understand whats the problem realy?
eny helpful link's are welcome also :)

Silver
crach@jutukas.com
icq: 97505332
 
You need to change MB_NO to IDNO and MB_YES to IDYES
 
Thank you, it worked :) Silver
crach@jutukas.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top