RE: Handling Errors

"'Glenn B. Lawler' [email protected] [blat]" <[email protected]>
Newsgroups gmane.mail.blat
Message-ID <!&!AAAAAAAAAAAYAAAAAAAAAH3fQh0qW/pHjsDKJ3Hs9vDCgAAAEAAAAFZNp9XOcHRGi9vxaKSRFBUBAAAAAA==@incodesystems.com>
Check ShellExecuteEx.

You can run synchronously to wait for the process to exit and then read the ERRORLEVEL set by blat.

You could use a batch, but you could also run blat directly.

 

Glenn Lawler

www.incodesystems.com

 

From: [email protected] [mailto:[email protected]] 
Sent: Monday, December 21, 2015 8:30 AM
To: [email protected]
Subject: [blat] Handling Errors

 



I have a Delphi program - it creates a batch file with a call to Blat - it executes the batch file with ShellExecute( ... ).  Which all works fine.

My problem is that if Blat fails (it did recently because the ISP changed the smtp server name) then I can't get the error fed back into my Delphi program.  The ShellExecute( ... ) is non-modal, Delphi sets the batch running and then ignores it and carries on.  The return value from ShellExecute relates to getting the batch file started, not to any problems the batch file might have.

I could get the batch to dump the errorlevel code into a file and then get the Delphi program to read the file (after an appropriate delay) - but it's all a bit of a cludge

 - is there a better way?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.