error C2146: syntax error : missing ')' before identifier 'WinExec'
I'm trying to launch some programs from a app i'm creating, but Visual C++ keeps giving me that error message. What is the identifier that is supossed to go with the WinExec. My code is listed below.
My OS is XP if that matters.
// TODO: Add your control notification handler code here
///////////////////////////
//MY CODE STARTS HERE
///////////////////////////
// Get the current values from the screen
UpdateData(TRUE);
// Declare a local variable for holding the program name
CString strPgmName;
// Copy the program name to the local variable
strPgmName = m_strProgToRun;
// Make the program name all uppercase
strPgmName.MakeUpper();
// Did the user select to run the Paint program?
if (strPgmName == "PAINT"
// yes, Run the Paint program
WinExec("pbrush.exe", SW_SHOW);
// Did the user select to run the Notepad program?
if (strPgmName == "NOTEPAD"
// yes, run the Notepad program
WinExec("notepad.exe",SW_SHOW);
// Did the user select to run the Solitaire program?
if (strPgmName == "SOLITAIRE"
// yes, run the Solitaire program
WinExec("sol.exe",SW_SHOW);
////////////////////////////////
//MY CODE ENDS HERE
///////////////////////////////
}
I'm trying to launch some programs from a app i'm creating, but Visual C++ keeps giving me that error message. What is the identifier that is supossed to go with the WinExec. My code is listed below.
My OS is XP if that matters.
// TODO: Add your control notification handler code here
///////////////////////////
//MY CODE STARTS HERE
///////////////////////////
// Get the current values from the screen
UpdateData(TRUE);
// Declare a local variable for holding the program name
CString strPgmName;
// Copy the program name to the local variable
strPgmName = m_strProgToRun;
// Make the program name all uppercase
strPgmName.MakeUpper();
// Did the user select to run the Paint program?
if (strPgmName == "PAINT"
// yes, Run the Paint program
WinExec("pbrush.exe", SW_SHOW);
// Did the user select to run the Notepad program?
if (strPgmName == "NOTEPAD"
// yes, run the Notepad program
WinExec("notepad.exe",SW_SHOW);
// Did the user select to run the Solitaire program?
if (strPgmName == "SOLITAIRE"
// yes, run the Solitaire program
WinExec("sol.exe",SW_SHOW);
////////////////////////////////
//MY CODE ENDS HERE
///////////////////////////////
}