I want to write a simple program in C++ to...

This is a discussion on I want to write a simple program in C++ to... within the Windows Programming forums, part of the Platform Specific Boards category; I want to write a simple program in C++ to open several other programs and files and then exit. I ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    Question I want to write a simple program in C++ to...

    I want to write a simple program in C++ to open several other programs and files and then exit. I use several files and programs frequently for web development and would like to be able do double-click and icon and have them open up.

    thanks!

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Ways to start other programs from a C/C++ program are discussed in the FAQ here.

    Tip, don't use the system() option.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    There are several solutions. One solution is CeateProcess().

    Kuphryn

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    As adrian says - goto the faq...

    But if you are opening documents and other files that are not exe files, but open inside exes, then use ShellExecute(Ex), as this function will look to the registry to see what program is registered to work with the file you want to open...example in the faq

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 12-30-2007, 09:08 AM
  2. need a simple program
    By Peter Griffin in forum C++ Programming
    Replies: 7
    Last Post: 12-04-2005, 03:23 PM
  3. Need help with simple, simple program.
    By LightsOut06 in forum C Programming
    Replies: 5
    Last Post: 09-01-2005, 08:31 PM
  4. Problem with simple XOR program
    By spike_ in forum C++ Programming
    Replies: 8
    Last Post: 08-17-2005, 12:09 AM
  5. simple frontend program problem
    By gandalf_bar in forum Linux Programming
    Replies: 16
    Last Post: 04-22-2004, 06:33 AM

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