C++ and Loading Executables

This is a discussion on C++ and Loading Executables within the C++ Programming forums, part of the General Programming Boards category; I am a programmer with experience in VB6, VB .Net and GAMBAS (Linux BASIC) and i have decided to learn ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    2

    C++ and Loading Executables

    I am a programmer with experience in VB6, VB.Net and GAMBAS (Linux BASIC) and i have decided to learn C++. I have done a considerable amount already but need a bit of help. Is there any way to load an executable file using c++ code. I want to call the program executable on command, like after the user has typed 'Y' or 'y'. I know about switch and case and i can open text and binary files in c++, but what i am looking for is the code to load an executable.

    To seem less confusing, the code in VB6 is...
    Dim RetVal
    RetVal = Shell("C:\where the file is\appname.exe", 1)

    This would load up the application and the main form would not exit (since it wasnt told too). I want the same functionality in my library program where it would be useful to load an executable from within the code. Is this possible using C++ or do i need to use another method ie a console script like a batch file or bash script.

    P.S. sorry for the VB code above, but best way to try and explain!!

    Thanks,
    MAniX

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    Just for you, we prepared this FAQ entry in anticipation of your arrival
    http://faq.cprogramming.com/cgi-bin/...&id=1043284392
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    2
    My bad!
    but thanks for the link, it did help.

    MAniX

Popular pages Recent additions subscribe to a feed

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