Shell Bug.. 0 returned when EXE is successfully launched 
Author Message
 Shell Bug.. 0 returned when EXE is successfully launched

I need the valid process number for some API calls.  However, when I launch
the EXE, (successfully) all that is returned is 0.

Does anyone know how to find out what causes the error?

Is it a MS bug?

Does anyone have a work around?

Thanks  Ed



Sat, 22 Nov 2003 02:19:07 GMT  
 Shell Bug.. 0 returned when EXE is successfully launched

Quote:
> I need the valid process number for some API calls.  However,
when I launch
> the EXE, (successfully) all that is returned is 0.

> Does anyone know how to find out what causes the error?

Use GetLastError to retrieve the last error generated.  If you
do this immediately
after CreateProcess returns zero, this should reflect why
CreateProcess did not
succeed.


Sat, 22 Nov 2003 03:55:30 GMT  
 Shell Bug.. 0 returned when EXE is successfully launched
Yes, the return value is Long.

I wrote a sample program for test in the office, and all worked fine on a
"dummy" EXE program, (a valid number was returned).  However, out in the
field where the project is, the EXE that has to be interfaced to starts up,
but the return value is 0.  I fundamentally pasted the code in.  Thanks for
your reply.


Quote:
> > I need the valid process number for some API calls.  However,
> when I launch
> > the EXE, (successfully) all that is returned is 0.

> > Does anyone know how to find out what causes the error?

> Use GetLastError to retrieve the last error generated.  If you
> do this immediately
> after CreateProcess returns zero, this should reflect why
> CreateProcess did not
> succeed.



Sun, 23 Nov 2003 08:18:47 GMT  
 Shell Bug.. 0 returned when EXE is successfully launched

Quote:
> Yes, the return value is Long.

> I wrote a sample program for test in the office, and all worked fine on a
> "dummy" EXE program, (a valid number was returned).  However, out in the
> field where the project is, the EXE that has to be interfaced to starts
up,
> but the return value is 0.  I fundamentally pasted the code in.  Thanks
for
> your reply.



> > > I need the valid process number for some API calls.  However,
> > when I launch
> > > the EXE, (successfully) all that is returned is 0.

> > > Does anyone know how to find out what causes the error?

> > Use GetLastError to retrieve the last error generated.

GetLastError doesn't work when calling API functions from VB because it gets
cleared by work that VB does after the API call.  Check the value of
Err.LastDLLError as well as Err.Number and Err.Description for possible
leads


Sun, 23 Nov 2003 08:48:16 GMT  
 Shell Bug.. 0 returned when EXE is successfully launched

Quote:
> GetLastError doesn't work when calling API functions from VB because it
gets
> cleared by work that VB does after the API call.  Check the value of
> Err.LastDLLError as well as Err.Number and Err.Description for possible
> leads

Thank you.  I must have burnt out the spot in my brain that's allocated
for that knowledge.  I end up saying "what the hell?" for a half an hour
before I remember Err.LastDLLError.


Sun, 23 Nov 2003 10:11:35 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. vb exe launch with shell

2. RMTSHARE.exe XCACLS.exe WSH Shell problems

3. Shelling to EXE not named EXE

4. Help Need to Exe a DOS exe from VB4 and return output

5. How Do I launch cc:Mail with shell()?

6. Wait for shelled application to launch???

7. Launch, then close a SHELL'd app?

8. launching a program using its registry entry NOT Shell()

9. Problem launching app from VB w/SHELL

10. Help: Launching aplications without Shell

11. is this a bug or am i crazy?

12. Shell launched application? Wata

 

 
Powered by phpBB® Forum Software