Solved

Get exit code from VB exe?

Posted on 2002-06-06
4
578 Views
Last Modified: 2010-05-02
How can I return an exit code from a vb 6 exe? One that could be trapped from another program or .bat errorlevel?
0
Comment
Question by:gferrell
[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
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
hes earned 200 total points
ID: 7060158
Use this

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

When you want to exit
ExitProcess 50& 'this returns a 50 for a 1 use
ExitProcess 1&
0
 

Author Comment

by:gferrell
ID: 7060187
In you experience, does this cause a problem since this command is unsupported in vb?
0
 
LVL 20

Expert Comment

by:hes
ID: 7060195
<<command is unsupported in vb? >>

How do you mean unsupported ? It is a Windows API
0
 

Author Comment

by:gferrell
ID: 7060224
unsupported in vb...I guess vb likes to close its own way:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288216

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 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