Help connecting .exe with this C++
 |
|
January 20th, 2003, 07:15 PM
|
#1
|
|
Banned
Join Date: Jan 2003
Location: NYC
Posts: 21
|
Help connecting .exe with this C++
ok here is the deal,
i made that prog where you select a program from the list and click to run it and it opens it. Now i can open notepad, calculator and small stuff like that, but when i try to connect ot open my fifa2003.exe it doesnt work.
this is the typing i use. But it doesnt work.
// Did you user select to run the Fifa2003 program?
if (strPgmName == "FIFA2003")
// yes, run the Fifa2003 program
WinExec("fifa2003.exe",SW_SHOW);
BUT when i do this it works
// Did you user select to run the FNotepad program?
if (strPgmName == "NOTEPAD")
// yes, run the Notepad program
WinExec("notepad.exe",SW_SHOW);
Is it because i need to connect the fifa 2003 dll files to the progy or what is wrong to it.
|
|
|
January 20th, 2003, 07:20 PM
|
#2
|
|
Thaumaturge Member
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,325
|
I think you'll need to include the path to the executable file. Windows knows where calc.exe is, but not FIFA2003. Try this:
WinExec("C:\insertpathhere\fifa2003.exe",SW_SHOW);
|
|
|
January 20th, 2003, 11:48 PM
|
#3
|
|
Banned
Join Date: Jan 2003
Location: NYC
Posts: 21
|
thanks but it gives me this error
warning C4129: 'P' : unrecognized character escape sequence
its C:\Program Files\fifa2003.exe
any ideas?
|
|
|
January 20th, 2003, 11:51 PM
|
#4
|
|
Member
Join Date: Feb 2002
Posts: 161
|
Replace the \ with \\
Within a string literal, a single \ is considered to be an escape sequence, and the character that follows is considered to be a control character. So if you want a string to contain the character \, you need to replace it with \\ so that it will be interpreted correctly.
|
|
|
January 21st, 2003, 12:20 AM
|
#5
|
|
Banned
Join Date: Jan 2003
Location: NYC
Posts: 21
|
Thanks to both of you, Martee that worked thank you so much, i really apreciate it. I just started playing with C++ few days ago for the hell of it, even though i wont need it till my senior year of college  but i might take it in sophmore if it goes smoothly
|
|
|
January 21st, 2003, 11:18 PM
|
#6
|
|
Thaumaturge Member
Join Date: Oct 2001
Location: West Haven, Utah
Posts: 15,325
|
Doh! I thought it would work that way since it's in quotes. Oh well, I don't know C++ anyway, so I don't feel too bad. 
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
Most Active Discussions
|
|
|
|
|
Recent Discussions 
|
|
|
|
|
|