943,746 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3028
  • C++ RSS
Aug 2nd, 2004
0

Running a program

Expand Post »
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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Aug 2nd, 2004
0

Re: Running a program

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!
Reputation Points: 36
Solved Threads: 11
Posting Pro in Training
Chainsaw is offline Offline
436 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: help neede about converting characters
Next Thread in C++ Forum Timeline: C++ Builder and Mappoint Pushpins Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC