Can't execute another program

This is a discussion on Can't execute another program within the C Programming forums, part of the General Programming Boards category; I can't seem to find a function that executes another program without running my processer at 100%. I'm running Windows. ...

  1. #1
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046

    Can't execute another program

    I can't seem to find a function that executes another program without running my processer at 100%. I'm running Windows. I tried all the FAQ's entries. system() is really slow, plus it runs my processor at 100%; spawn* runs at 100% too; so does exec*; CreateProcess runs my DOS program in a new window (I want it to run in the same window); and ShellExecute runs at 100%.

    What would everyone suggest using?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220

  3. #3
    Rog
    Rog is offline
    Registered User
    Join Date
    Jan 2003
    Posts
    78
    Quote Originally Posted by dwks
    CreateProcess runs my DOS program in a new window (I want it to run in the same window
    It doesn't do that by default... check your process creation flags and startupinfo structure and make the required changes. All parameters are fully explained in the Platform SDK.

    -Rog

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Thanks . . . I got it to open in the same window [edit](CreateProcess(), that is)[/edit], and now it too is running my processor at 100%. It must be my OS . . . Windows 98se if that helps.
    Last edited by dwks; 08-06-2005 at 09:07 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Did you consider taht the program you are running might just use 100% of your CPU?

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    It doesn't. If I run it myself, the CPU runs at about 2%. Besides, I've tried all sorts of programs.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Then provide a testcase.

  8. #8
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    You mean, post the program I'm trying to run?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a program that will call an execute but with arguments
    By what3v3r in forum C++ Programming
    Replies: 3
    Last Post: 01-19-2006, 08:44 PM
  2. Need help on code to execute the program
    By hibmem10 in forum C++ Programming
    Replies: 6
    Last Post: 12-24-2005, 12:42 PM
  3. Can't execute my program
    By bahruddina in forum C Programming
    Replies: 4
    Last Post: 07-13-2004, 10:19 PM
  4. simple frontend program problem
    By gandalf_bar in forum Linux Programming
    Replies: 16
    Last Post: 04-22-2004, 06:33 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21