• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

Get exit code from VB exe?

How can I return an exit code from a vb 6 exe? One that could be trapped from another program or .bat errorlevel?
0
gferrell
Asked:
gferrell
  • 2
  • 2
1 Solution
 
hesCommented:
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
 
gferrellAuthor Commented:
In you experience, does this cause a problem since this command is unsupported in vb?
0
 
hesCommented:
<<command is unsupported in vb? >>

How do you mean unsupported ? It is a Windows API
0
 
gferrellAuthor Commented:
unsupported in vb...I guess vb likes to close its own way:

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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now