CreateProcess() or ?

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
In a C++ application, I need to call the external program "setup.exe" and then exit quickly. "setup.exe" performs updates on the program that calls it.

Windows has an API called CreateProcess() that I am thinking about using, but their example on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_processes.asp shows WaitForSingleObject() and CloseHandle() calls immediately after.

I can not wait. The program needs to shut down immediately after calling the external program "setup.exe".

Is there a different way to call CreateProcess() that is better for my situation, or do I need to use something else?
 
You don't need to use the API though, it's wrapped in the .NET Framework:

Visual Basic:
Process.Start("c:\setup.exe")

**EDIT** There is a bug in the [ vb ] tags that has removed my '\' after c: there. It's definitely there.
 
Thanks. From the example, I understood that I had to wait for the thread to complete. That's what I needed. Maybe Microsoft could update their MSDN site to include that information one day. :)
 
Back
Top