Solved

Returning an integer from an Application

Posted on 2000-03-06
3
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

691 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