Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Returning status code from VB exe
How do I return a status code fom a VB (6) program, so that I can test it in
.BAT command file.
Matti



Report this thread to moderator Post Follow-up to this message
Old Post
Matti
05-25-05 08:55 PM


Re: Returning status code from VB exe
"Matti" <me@here.invalid> wrote in message
news:uo5EZYUYFHA.2128@TK2MSFTNGP14.phx.gbl
> How do I return a status code fom a VB (6) program, so that I can
> test it in .BAT command file.

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

Be careful using it as it is a very abrupt termination.  Make sur eyou have
unloaded all forms, closed all files and done all cleanup first.  You should
also avoid calling it when running in the IDE since it will kill your VB
session without saving.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."


Report this thread to moderator Post Follow-up to this message
Old Post
Bob Butler
05-25-05 08:55 PM


Re: Returning status code from VB exe
Matti wrote:
> How do I return a status code fom a VB (6) program, so that I can
> test it in .BAT command file.

Echo everything Bob said, plus offer these examples:

http://vb.mvps.org/samples/Console
http://vb.mvps.org/samples/Hello

Be careful...
--
Working Without a .NET?
http://classicvb.org/petition



Report this thread to moderator Post Follow-up to this message
Old Post
Karl E. Peterson
05-25-05 08:55 PM


Re: Returning status code from VB exe
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:Oum8HcUYFHA.3620@TK2MSFTNGP09.phx.gbl...
> "Matti" <me@here.invalid> wrote in message
> news:uo5EZYUYFHA.2128@TK2MSFTNGP14.phx.gbl 
>
> Private Declare Sub ExitProcess Lib "kernel32" _
>   (ByVal uExitCode As Long)
>
> Be careful using it as it is a very abrupt termination.  Make sur eyou
have
> unloaded all forms, closed all files and done all cleanup first.  You
should
> also avoid calling it when running in the IDE since it will kill your VB
> session without saving.

and remember to use

start /wait VBProgram.exe

in your batch file, so that it actually /waits/ for the VB program to
/finish/ before sampling the return value.

HTH,
Phill  W.



Report this thread to moderator Post Follow-up to this message
Old Post
Phill. W
05-26-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.