DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Jabugalu Guest

    Calling External Programs with C++ code


    I was wondering if anyone could help me with the code nessecary to call
    external
    windows pgorams from a terminal c++ program. I dont know the code to do this.
    I would only need to run the external program not interact with it. Any
    help would be greatly appreciated.

  2. #2
    jonnin Guest

    Re: Calling External Programs with C++ code


    system("c:\...\whatever.exe");
    or
    lookup spawn*.*, shellexecute*(win32), etc for more powerful commands.



    "Jabugalu" <activematrix@netzero.net> wrote:
    >
    >I was wondering if anyone could help me with the code nessecary to call
    >external
    >windows pgorams from a terminal c++ program. I dont know the code to do

    this.
    > I would only need to run the external program not interact with it. Any
    >help would be greatly appreciated.



  3. #3
    Christer Brännström Guest

    Re: Calling External Programs with C++ code


    The prefered way to create another process in win32 should be something like
    this. It gives the developer more control, but then again it is more complicated.

    PROCESS_INFORMATION pi;
    STARTUPINFO si;
    memset(&si, 0, sizeof(si));
    si.cb = sizeof(si);

    if (CreateProcess(0, "C:\KEFFO\kickass.exe", 0, 0, FALSE,
    NORMAL_PRIORITY_CLASS, 0, 0,
    &si, &pi)) {
    // ERROR
    }
    WaitForSingleObject(pi.hProcess, INFINITE);
    CloseHandle(pi.hThread);
    CloseHandle(pi.hProcess);



    "jonnin" <jonnin@vol.com> wrote:
    >
    >system("c:\...\whatever.exe");
    >or
    >lookup spawn*.*, shellexecute*(win32), etc for more powerful commands.
    >
    >
    >
    >"Jabugalu" <activematrix@netzero.net> wrote:
    >>
    >>I was wondering if anyone could help me with the code nessecary to call
    >>external
    >>windows pgorams from a terminal c++ program. I dont know the code to do

    >this.
    >> I would only need to run the external program not interact with it. Any
    >>help would be greatly appreciated.

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links