Start a new program with your program.

This is a discussion on Start a new program with your program. within the C++ Programming forums, part of the General Programming Boards category; I got 2 .exe files and want to start the other program with the first file. I've got it working ...

  1. #1
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90

    Start a new program with your program.

    I got 2 .exe files and want to start the other program with the first file.
    I've got it working with:
    Code:
    system("blablabla.exe");
    But that kinda builds in the the program to the first one.

    Like if both programs are like this:
    1: Print "lol"
    2: Print "omfg"

    So when I start the first program, it prints" lol", then it opens program 2 and prints "omfg" in the same DOS window as "lol".

    If you understand what I mean. :P
    I want it to be 2 windows running alone.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,672
    Then each process/program will need to create its own window for output.

    Someone else should be able to help with that.
    I used to be an adventurer like you... then I took an arrow to the knee.

  3. #3
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    is this what you are looking for?

    Code:
    system("start blablabla.exe");

  4. #4
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90
    Rocky, that works but it exits the first window.
    I want to keep the first program still running.

    nvm, im stupid...
    fixed it.
    Last edited by XunTric; 10-04-2005 at 06:35 AM.

  5. #5
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    oh, you may want to use CreateProcess then, and call WaitForSingleObject on the executed process handles.

  6. #6
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90
    Quote Originally Posted by XunTric
    nvm, im stupid...
    fixed it.
    Thanks anyway!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make my program run on windows start up
    By kantze in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 03-24-2007, 11:14 AM
  2. How to start program from subfolder
    By trancedeejay in forum C Programming
    Replies: 2
    Last Post: 04-01-2006, 02:39 PM
  3. Start up program
    By Breetai in forum Windows Programming
    Replies: 2
    Last Post: 01-11-2003, 12:12 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM
  5. Start a program
    By FunkeeMunkee in forum C++ Programming
    Replies: 1
    Last Post: 08-26-2001, 07:18 PM

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