Solved

Returning an integer from an Application

Posted on 2000-03-06
3
155 Views
Last Modified: 2010-05-02
I have writen an application in Visual Basic.  This application is invoked from a program which is writen in java.
The java program waits until my application has finished and then continues.
The question is .. How do I pass an integer (ie. an error code) back to the java program ?? (or just out of the VB application at the end of Sub Main .. No forms in this App.)
0
Comment
Question by:RogerT
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 2588540
Use the following:

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

Then at the end of Sub Main

ExitProcess 50& (or whatever integer you want)
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2588583
"HOWTO: Set an Error Level from a Visual Basic Application"
http://support.microsoft.com/support/kb/articles/Q178/3/57.ASP

Use ExitProcess() only after freeing all objects, and unloading all forms.
0
 
LVL 20

Expert Comment

by:hes
ID: 2588777
Use this

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

Then at the end of Sub Main

ExitProcess 50& (or whatever integer you want)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 47
Adding to a VBA? 6 85
Run code from text file in vb 1 87
Add a task in Outlook from access 11 43
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question