Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I issue return codes in a VB App 1

Status
Not open for further replies.

CybOrg

Programmer
Nov 30, 1998
57
SE
We just installed a Batch job queue system which among other things can act one way or the other based on an app's return code. Return codes are common in the mainframe world, but how do I issue a return code from inside a VB app?

Cy
 
Did you ever figure this out? I would be interested in how you did it.

Thanks.
 
To have a VB program issue a return value upon exit, first declare the following API

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

Then in the form unload of the main form

Private Sub Form_Unload(Cancel As Integer)
ExitProcess CLng(<your return value>)
End Sub
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top