Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run exe with file parameter
Message
 
To
23/03/2006 05:40:54
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01106228
Message ID:
01106922
Views:
26
>The only reason is that I've never used them before but I'm interested.
>Is there any goog help to have look at it.
>Thanks,
>Tamas
>>>I would like to have an .exe file running with a file as a parameter, which should start(the exe) within a prg. But I'm always getting the same error message:"Command error". I have tried command RUN but it doesnt work.
>>>TIA
>>>Tamas Szigeti
>>
>>Is there any special reason you don't want to use ShellExecute()?
#define SW_HIDE             0
#define SW_NORMAL           1
#define SW_SHOWMINIMIZED    2
#define SW_SHOWMAXIMIZED    3
#define SW_MAXIMIZE         3
#define SW_SHOWNOACTIVATE   4
#define SW_SHOW             5
#define SW_MINIMIZE         6

* Error codes return from ShellExecute
**** regular WinExec() codes *
#define SE_ERR_FNF              2       && file not found
#define SE_ERR_PNF              3       && path not found
#define SE_ERR_ACCESSDENIED     5       && access denied
#define SE_ERR_OOM              8       && out of memory
#define SE_ERR_DLLNOTFOUND     32

* error values for ShellExecute() beyond the regular WinExec() codes
#define SE_ERR_SHARE                    26
#define SE_ERR_ASSOCINCOMPLETE          27
#define SE_ERR_DDETIMEOUT               28
#define SE_ERR_DDEFAIL                  29
#define SE_ERR_DDEBUSY                  30
#define SE_ERR_NOASSOC                  31



DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
                                             STRING cOperation,;
                                             STRING cFileName,;
                                             STRING cParameters,;
                                             STRING cDirectory,;
                                             INTEGER nShowWindow
******lRef= 'C:\Program Files\Utvonal\Utvhatar.exe ' + 'hamiTszt.txt'
result = ShellExecute(0, 'Open', [Utvhatar.exe] , [hamiTszt.txt], [C:\Program Files\Utvonal], SW_NORMAL)
IF result < 33 && Some Error happens
*   check for errors see defines above
   *** Some error happened
ENDIF
(not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform