#include "stdafx.h"
#include <string>
#include <windows.h>
int main()
{
char* sStr;
sStr="notepad.exe";
WinExec(sStr,SW_SHOW);
return 0;
}
Printable View
#include "stdafx.h"
#include <string>
#include <windows.h>
int main()
{
char* sStr;
sStr="notepad.exe";
WinExec(sStr,SW_SHOW);
return 0;
}
The Windows headers don't use the STL, and as such don't understand the string class. Use this:
PS: WinExec is obsolete and shouldn't be used any more, as it is expected to be deprecated in later versions of Windows.Code:WinExec(sStr.c_str(), SW_SHOW);