Thank you for your info.
By default, the Shell function runs other programs asynchronously.
This means that a program started with Shell might not finish
executing before the statements following the Shell function are
executed.
My application needs to determine whether to trigger another C++
program for this id and continue to process the same things for other
ids based on whether the 1st C++ was completely and successfully
finished. That's why I use those APIs. I do not think Shell function
can handle this. I got it working already. Thanks.
Marilyn
> I'm probably out of my depth here, but could you not get the needed
info
> from the Shell() function? That is, something like:
>
> dblReturn = Shell("c:\MyProg.exe")
>
> Supposedly this returns 0 if MyProg.exe returns an error code (and
the task
> ID otherwise).
>
> Alternatively, the windows script host library has a WshShell object
w/a
> .Run method, which is supposed to return the actual error code of
the called
> program.
>
> HTH,
>
> -Roy
>
> -----Original Message-----
> From: Chris Ellegood [mailto:jcellegood@h...]
> Sent: Friday, January 19, 2001 10:48 AM
> To: professional vb
> Subject: [pro_vb] Re: API - please help
>
>
> When you say that it ran successfully, do you mean that the program
has
> terminated?
>
> Thanks.
>
> Chris Ellegood, ATP, xxx-xxx-xxxx
>
>
> ----- Original Message -----
> From: <rickymarilyn@s...>
> To: "professional vb" <pro_vb@p...>
> Sent: Friday, January 19, 2001 12:34 PM
> Subject: [pro_vb] API - please help
>
>
> > Hi everybody,
> >
> > I used the folllowing API functions to trigger a C++ application
in of
> > my VB application.
> >
> > CreateProcessBynum
> > WaitForInputIdle
> > WaitForSingleObject
> > GetExitCodeProcess
> >
> > The reason I used API functions is I need to know the called
program
> > is run successfully or not. One of the parameters, lpExitCode, in
> > GetExitCodeProcess API function should retrieve the process
> > termination status but it always returns 0 indicating success even
> > when the called program was bumped out. Therefore, the VB app
still
> > continues to process the other logic when the called program
bumped
> > out.
> >
> > Any idea or help would be appreciated.
> >
> > Marilyn
> >
> >
> >