Hi guys,
If exe A calls exe B, using winexec() or waitrun(), how to get the value returned by exe B?
TIA
How to obtain return value of a called exe?
How to obtain return value of a called exe?
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: How to obtain return value of a called exe?
WaitRun() is expected to return the exitcode of executed exe.
But somehow I could not get reliable results.
You may try testing it.
But somehow I could not get reliable results.
You may try testing it.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: How to obtain return value of a called exe?
Thanks for the reply Rao.
I didn't manage to get it too and when I check the documentation it says waitrun() returns hInstance.
So I just wrote a workaround by having exe B dumped the return value in a file for exe A to read. It serve the purpose but not as neat as having exe A reading directly exe B's return value.
I didn't manage to get it too and when I check the documentation it says waitrun() returns hInstance.
So I just wrote a workaround by having exe B dumped the return value in a file for exe A to read. It serve the purpose but not as neat as having exe A reading directly exe B's return value.
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: How to obtain return value of a called exe?
Returns hInstance when __FLAT__ is not defined.
FWH is compiled with __FLAT__ defined.
The function should return ExitCode
Mr Antonio can explain better.
FWH is compiled with __FLAT__ defined.
The function should return ExitCode
Code: Select all
hb_retnl( dwExitCode );
This is the best thing to do.So I just wrote a workaround by having exe B dumped the return value in a file for exe A to read
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: How to obtain return value of a called exe?
To communicate two exes programs. Send parameters or returns information:
- You can use aRead() and aSave() functions.
- Or better FW_ValToExp() funcion with memowrit() and & operator with memoread().
- You can use aRead() and aSave() functions.
- Or better FW_ValToExp() funcion with memowrit() and & operator with memoread().
Re: How to obtain return value of a called exe?
Thanks for the input Paco
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
Re: How to obtain return value of a called exe?
Thanks for the input Antolin. I do use ini file quite a lot.
Speaking of ini file, I find it annoying that it doesn't leave a blank space in between sections. It makes it hard to read and edit manually
Speaking of ini file, I find it annoying that it doesn't leave a blank space in between sections. It makes it hard to read and edit manually
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC