Executable Exit Code

Ed James
12-11-2002, 03:04 PM
Does anyone know if it is possible to write an executable program in VB which has an exit code of 1. The standard 'Main' sub doesn't return anything and I don't want to use a dialog project as this executable is to run as the first step of an uninstaller and will do various cleanup jobs before the uninstaller begins.
The uninstaller requires this cleanup program to terminate with an exit code of 1 otherwise the uninstaller will not run. Is this possible in VB ?
Any comments welcome.

Flyguy
12-11-2002, 03:08 PM
You could try the ExitProcess API, but be sure to read this article on the MS support pages:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288216

Ed James
12-16-2002, 02:30 AM
Thanks very much that's very helpful. I've found the API method

Declare Sub PostQuitMessage Lib "user32" Alias "PostQuitMessage" (ByVal nExitCode As Long)

Do you know of any problems with this ?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum