SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Is there a way to get an exit code from a VB .

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Is there a way to get an exit code from a VB .
Author Message
James Johns



Joined: 06 Oct 2003
Posts: 15

Post Is there a way to get an exit code from a VB . exe Reply with quote


Is there a way to get an exit code from a VB . exe file?

Sub Main() does not return a value (only Functions return a value in VB).

It is possible to call "ExitProcess" in the Kernel, but that shuts everything down!



Mon Oct 06, 2003 2:02 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Is there a way to get an exit code from a VB . Reply with quote

What do you mean by "everything down". If you call ExitProcess it will end your exe process and set the return code.

If you are talking about a VBScript macro run in 24x7 Scheduler do not use ExitProcess because this will terminate the scheduler. Instead use RaiseError method to signal an error.

: Is there a way to get an exit code from a VB . exe file?

: Sub Main() does not return a value (only Functions return a value in VB).

: It is possible to call "ExitProcess" in the Kernel, but that shuts
: everything down!

Mon Oct 06, 2003 7:58 am View user's profile Send private message
Mr COMET



Joined: 11 Jan 2004
Posts: 1

Post Re: Is there a way to get an exit code from a VB . Reply with quote

: What do you mean by "everything down". If you call ExitProcess it
: will end your exe process and set the return code.

: If you are talking about a VBScript macro run in 24x7 Scheduler do not use
: ExitProcess because this will terminate the scheduler. Instead use
: RaiseError method to signal an error.

Perhaps you should leave the coding up to the developers ?

Mon Nov 03, 2003 9:55 pm View user's profile Send private message
Biz



Joined: 23 Feb 2004
Posts: 1

Post Re: Is there a way to get an exit code from a VB . Reply with quote

: Perhaps you should leave the coding up to the developers ?

Mr C - I'm sure you needed help at some point. Perhaps Mr. Johns wants to make his own program because developers do not have what he wants.

Anyway...I know if you use "Unload FORMNAME", it will unload the form.
Not sure about any child forms...if they were part of a program.

Sun Jan 11, 2004 2:01 am View user's profile Send private message
Jason Kilgrow



Joined: 23 Feb 2004
Posts: 7

Post Re: Is there a way to get an exit code from a VB . Reply with quote

: Mr C - I'm sure you needed help at some point. Perhaps Mr. Johns wants to
: make his own program because developers do not have what he wants.

: Anyway...I know if you use "Unload FORMNAME", it will unload the
: form.
: Not sure about any child forms...if they were part of a program.

I'm having the same difficulty.
I'm writing a console application that requires
the application to return a value to the calling
program - in this case, the OS (batch file, etc.)
I've been searching the web and some VB books
for a few days now and I
can't find any information on how to do this.
If anyone comes across anything, please post
or email me directly.

Oh, and by the way, Mr. C, I AM a professional,
senior developer. Just because someone doesn't know
how to do something isn't an excuse to get snotty.

Mon Feb 23, 2004 7:19 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Is there a way to get an exit code from a VB . Reply with quote

When in your console application code you do "exit([my code here])" that's the exit code of your program returned to the calling process - in your case, the OS (batch file, etc.).

For more info please see any C/C++ handbook or system-programming manual.

: I'm having the same difficulty.
: I'm writing a console application that requires
: the application to return a value to the calling
: program - in this case, the OS (batch file, etc.)
: I've been searching the web and some VB books
: for a few days now and I
: can't find any information on how to do this.
: If anyone comes across anything, please post
: or email me directly.

: Oh, and by the way, Mr. C, I AM a professional,
: senior developer. Just because someone doesn't know
: how to do something isn't an excuse to get snotty.

Mon Feb 23, 2004 10:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Is there a way to get an exit code from a VB . Reply with quote

By the way, in VB you cannot write a true console application. You can create a GUIless application, but this is not exactly the same thing.

In VB declare use Windows API function ExitProcess. Here is the copy/paste from Windows SDK docs.

The ExitProcess function ends a process and all its threads.

VOID ExitProcess(

UINT uExitCode // exit code for all threads
);

For more info and examples try
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=VB+ExitProcess+examples

: When in your console application code you do "exit([my code here])"
: that's the exit code of your program returned to the calling process - in
: your case, the OS (batch file, etc.).

: For more info please see any C/C++ handbook or system-programming manual.

Mon Feb 23, 2004 10:45 pm View user's profile Send private message
Jason Kilgrow



Joined: 23 Feb 2004
Posts: 7

Post Re: Is there a way to get an exit code from a VB . Reply with quote

: By the way, in VB you cannot write a true console application. You can create
: a GUIless application, but this is not exactly the same thing.

: In VB declare use Windows API function ExitProcess. Here is the copy/paste
: from Windows SDK docs.

: The ExitProcess function ends a process and all its threads.

: VOID ExitProcess(

: UINT uExitCode // exit code for all threads
: );

: For more info and examples try
: http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=VB
: +ExitProcess+examples

SUCCESS!! Thank you!

Tue Feb 24, 2004 1:50 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.