|
-
Apr 20th, 2001, 03:54 PM
#1
Thread Starter
Lively Member
#include "stdafx.h"
#include <string>
#include <windows.h>
int main()
{
char* sStr;
sStr="notepad.exe";
WinExec(sStr,SW_SHOW);
return 0;
}
-
Apr 20th, 2001, 04:00 PM
#2
Monday Morning Lunatic
The Windows headers don't use the STL, and as such don't understand the string class. Use this:
Code:
WinExec(sStr.c_str(), SW_SHOW);
PS: WinExec is obsolete and shouldn't be used any more, as it is expected to be deprecated in later versions of Windows.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|