• Welcome to Valhalla Legends Archive.
 

Forcing a VB program to return completion code

Started by Grok, February 21, 2005, 01:53 PM

Previous topic - Next topic

Grok

When calling a typical command-line program written in C, the return value can be handled.  But from VB6 programs, there is no way to set the return value.  Does someone (TheMinistered?) maybe know how to set the return value such that when my program completes, it returns some value I specify in my VB code?

K

Can you not just use ExitProcess(return_val) when you reach then end of your code?

Newby

Public Declare Sub ExitProcess Lib "kernel32" Alias "ExitProcess" (ByVal uExitCode As Long)
See if that works.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

TheMinistered

You should use a function to determine if you are in the IDE or not, otherwise you may get unexpected results :) i.e. IDE will close as well :)