Running a program

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Running a program

 
0
  #1
Aug 2nd, 2004
Hi everyone,
i need some guidance or help if possible help with running a program in c++. I am currently using this statement to run any external program in c++.

WinExec("C:\gui.exe", SW_SHOW);

The above command compiles ok but the external program is not executed.
There seems nothing wrong with my external program as i have tried to run it using other programming languages and it works. Can someone tell me what i am doing wrong. Can someone show me or e-mail me the right way of doing this. My e-mail is freesoft_2000@yahoo.com

Another thing to add is does anyone know how to use the CreateProcess function and show me a simple example of using this function.

Any help is deeply appreciated

Thank You

Yours Sincerely

Richard West
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 11
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: Running a program

 
0
  #2
Aug 2nd, 2004
What does these strings have in common?

"New Line:\n"
"One Tab:\t"
"Imbedded quote:\""
"C:\gui.exe"

The poor runtime is trying to figure out what a \g is (used to be the BELL char). Try:

"C:\\gui.exe"

or maybe

"C:/gui.exe"

(not sure if that one will work on all os'.)

Good luck!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC