home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Help connecting .exe with this C++

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1828
Discussions: 200,979, Posts: 2,379,832, Members: 246,341
Old January 20th, 2003, 07:15 PM   Digg it!   #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.
Pickolizac is offline   Reply With Quote
Old January 20th, 2003, 07:20 PM     #2
Thaumaturge Member
 
howste's Avatar
 
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);
howste is offline   Reply With Quote
Old 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?
Pickolizac is offline   Reply With Quote
Old 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.
Martee is offline   Reply With Quote
Old 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
Pickolizac is offline   Reply With Quote
Old January 21st, 2003, 11:18 PM     #6
Thaumaturge Member
 
howste's Avatar
 
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.
howste is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Charges against non-tippers dropped.. (19)
Health Care Rationing (9)
Is It Just Me? (3062)
Delete an OS (16)
Nvidia GTX 260 problem (9)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (18)
Regular Build (11)
Point and Shoot Camera Suggestions. (7)
windows 7 problem (7)
Internet Lost (5)
Multiple Restarts Required at Boot (5)
Recent Discussions
Unallocated Space (0)
help me pls laptop just stopped worki.. (1)
cheap gaming laptop? (11)
C# + LINQ Help (7)
windows vista security holes (18)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (38)
Nvidia GTX 260 problem (9)
Dynex DX E-402 (3)
EVGA 9800 gtx help with finding a goo.. (12)
Multiple Restarts Required at Boot (5)
Point and Shoot Camera Suggestions. (7)
Delete an OS (16)
cell phone won't work (0)
Is the PSU I received dead? (15)
Can't open Word (12)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)


All times are GMT -4. The time now is 01:14 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.