Either that or just write something to a file and then check it after your EXE 
ends.


----- Original Message ----- 
From: Stuart Dunkeld 
To: ProFox Email List 
Sent: Thursday, July 02, 2009 10:56 AM
Subject: Re: How can you get a return code from VPF executable


Have a look at http://fox.wikis.com/wc.dll?Wiki~ExitCode - essentially
you need to call the WIn32API function ExitProcess with your return
code (which must be an integer) to end your VFP program.

Regards

--stuart

On Thu, Jul 2, 2009 at 6:44 PM, Jean Haidar<[email protected]> wrote:
> we have an VFP executable that return either .T. if it run without errors and 
> return .F. in case of errors
>
> we have used tried many ways to check its return code.
>
> from VFP:
>
> strExe = "c:\batch_process\TEST.exe DATE()-35 DATE()"
> cretcode = loshell.Run(strExe,1,.t.)
>
>
> the cretcode is always returning 0 whether or not the VFP exe produce an 
> error or NOT.
> we are inserting the error info into a table when TEST.Exe produce an error
>
>
> we also tried this code from VB.NET
>
> Dim
> myProcess.EnableRaisingEvents = myProcess AsProcess = 
> NewProcess()TruemyProcess.StartInfo.FileName = 
> "C:\Jean_dev\Batch_process\TEST.exe"' ArgumentsmyProcess.StartInfo.Arguments 
> = " date()-35 date() "myProcess.StartInfo.RedirectStandardOutput = 
> TruemyProcess.StartInfo.UseShellExecute = FalsemyProcess.Start()' need to 
> wait until it is finishedDoWhilemyProcess.HasExited = False Dimlctime = 
> NowLoopDimnexitcode = myProcess.ExitCodeDimoutput AsString= 
> myProcess.StandardOutput.ReadToEnd()
>
>
> nexitcode is always 0 and output is a blank string
>
>
> we are want to avoid writing a DLL and registering on the Server.
>
>
> Jean Haidar
> [email protected]
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/39bcb6508ea842568929f1434b935...@w2k3s02
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to