Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Apr : Terminate app with some error code or something like
| Subject: | Terminate app with some error code or something like |
| Posted by: | "Churc" (cebas..@gmail.com) |
| Date: | 25 Apr 2007 07:23:01 |
Hello all :D
Its me again auhahua
There is a way to terminate a app with some Exit, Error code that the
caller can know?
Example
I did a small app to load another one, and i did:
[Loader Code - loader.exe]
if (FileExists('myapp.exe')) and
(WinExec(PChar('myapp.exe ' + RDLEncrypt('Data2Encript',
'Key4Encrypt')), SW_SHOWNORMAL) <= 31) then
begin
Support := TSupport.Create(nil);
try
Support.ShowModal;
finally
Support.Release;
Support := nil;
end;
end;
[End Code]
Ok, WinExec returns a code, if its greater than 31 then the app was
executed correctly but if not then something is wrong and i show a form
to the user can request support for... since my program runs like a
Shell and if it got problem, then the user cant use the machine, and
only some advanced user will can resolve it...
Ok, but im using some encryptations methods, and to avoid any problems
like i said, i would like to know if there is a way to Exit my app,
myapp.exe in this case, with some code to the loader know if there is a
problem...
Example,
if not (RDLDecrypt(szParams, 'bla') = 'ble) then
Exit(1);
It not work, but just as example to the caller knows about the Exit
Code = 1
Its possible?
Thank you all and sorry for my bad english asuhsuh x
Best Regards
Carlos
--