api - Trying to obtain error codes from a .NET executable I run from VB6 -


I execute a .NET console app from ViB 6 using ShellExecute API call:

  ExitCode = ShellExecute (Me.hWnd, "Open", GetAppPath & "\ SQL Utilities \" and "DocXferClient.exe", strFlags, vbNull, SW_HIDE)   

In the .NET App (DocXFerClient), I send an attempt to return an "error code" using the environment. Excerod:

  sub-main () build connection object () process (environment) .exitcode = 55 end all   

However, whatever error code I try to return (In this case "55"), ExitCode always "42." within VB6. Am I doing something wrong in VB6 side, .NET side or both?

ShellExecute does not return any exit code This success ( 32 more value) or a failure ( 32 or less)

Mandatory Raymond Chen Link:


> To obtain the exit code, use.

To handle the process, run your app together, do not ShellExecute .

Do not forget both calling process and thread handles this return.

Comments