1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

To run an application from c/c++ program

Discussion in 'C++' started by transfernly, Apr 22, 2010.

  1. transfernly

    transfernly New Member

    Joined:
    Dec 15, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    Hello all,

    i am in need of developing an application (writing a C/c++ code ) to Run an application(say for example a vlc player or any as such) from the Code and get its process ID and perform certain manipulation and then kill it .....

    i want the application to run both in windows and Linux too..

    Anyone here suggest me how to do this....

    i heard like "system" command would be of help

    i have been googling for good tutorials but no help..

    Anyone here guide me...

    any help is highly appreciated

    thanks and regards
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    This bit will be difficult; these operations are OS-specific. So you will need (a) a toolkit that provides platform-independent access to these functions or (b) write different programs for eac.
     
  3. davidk

    davidk New Member

    Joined:
    Mar 25, 2010
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    0
    Home Page:
    For Windows consider using CreateProcess().

    For Linux - fork() and then execve().

    They all are documented well, look msdn and man-pages.
     

Share This Page