Return an exit-code from a running VB 6 application 
Author Message
 Return an exit-code from a running VB 6 application

I'm programing a Visual Basic 6 application under Windows 95 for target
system Windows NT.

My application will be started by another process (parrent process)
which waits until my application ends.
My application should return an exit code to its parent process for
error indication, f.e. 1 if an error occured and 0 if no error happened.

How can i program this functionality of returning an errorcode or in
general an exit code in VB 6.
I tried to do that:

Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

Private Sub Form_Terminate()
    ExitProcess 3&
End Sub

but my batch-File which starts my VB6 test.exe application under Windows
95

      echo off
      start /w test.exe
      if errorlevel 0 goto 100
      if errorlevel 1 goto 200
      goto Done
      :100
      echo Exit Code 0
      goto done
      :200
      echo Exit Code 1
      goto done
      :done
      echo done

shows my always "Exit Code 0".



Sun, 18 May 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Can VB return exit code on program termination as exit(X) in C

2. Howto: return exit code from a VB program

3. Return exit code from VB program

4. Haw do I return a VB exit code ?

5. Exit Codes from VB Application.

6. Putting a DOS Application Inside my VB EXE, Then run it and get what it returns

7. How to return exit code

8. How returning an exit code from VB6

9. Exit ap with a return code

10. Exit Return Code

11. runtime always return exit code 0

12. Exit script with return code?

 

 
Powered by phpBB® Forum Software