Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinExec() does not accept a path
Message
From
28/10/1997 23:58:07
 
 
To
28/10/1997 21:30:45
General information
Forum:
Visual C++
Category:
Troubleshooting
Miscellaneous
Thread ID:
00057147
Message ID:
00057153
Views:
24
1. You must use double quotes instead of single quotes as delimiters for your string. Single quotes are delimiters for single characters.
2. In C/C++ the backslash char is reserved char used to specify special characters (like an escape code). Here is a short list of special chars (there are many of them :)):

\ -> \\
CR -> \n
Tab -> \t
Ascii code zero -> \0

So, you need WinExec("c:\\windows\\notepad.exe",SW_SHOWNORMAL)...

Vlad


>In Visual C++ 5.0, I have a WinExec() statement used to start an EXE. It goes like this: WinExec('notepad.exe',SW_SHOWNORMAL). This works fine. However, as soon as I try to put a full path, Visual C++ returns an error at build time. I can't do something like this: WinExec('c:\windows\notepad.exe',SW_SHOWNORMAL).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform