Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute Lost in Space?
Message
 
 
To
16/05/2011 15:28:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01510794
Message ID:
01510802
Views:
53
>>>>Have you verified what does lcFileName containt? Perhaps you need to pass the file name with the full path?
>>>>Also, you may want to examine the error code from ShellExecute - it provides the reason why the command fails.
>>>
>>>Yes, that's not an issue. The external executable has a config file that tells it where to look for the files to be processed. My impression is that ShellExecute doesn't produce an error, just that the external executable doesn't produce any output, but I will check that further.
>>
>>Still, returning the value from ShellExecute is a must, IMHO.
>
>Just tried it both ways. RunAny (ShellExecute) returns 42 in both cases, but the external executable produces output when run from the command window, not when run within the app. The is a slight delay before the output file shows up, maybe a second or so; could that be having some effect? Stopping the process after the first file in Trace mode, however, still does not get any output from within the app, no matter how long I wait. And that's regardless of whether the DOEVENTS or the Sleep() call has been made.

42 means it was a successful code (according to http://www.oehive.org/node/528 )

If you exit from the loop after the first iteration, does the output file get created? Looks like you will need to debug this external app.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform