Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shellexec
Message
 
To
11/04/2000 17:07:08
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00358330
Message ID:
00358588
Views:
15
>>>I'm doing it like below, but I still see the imaging window flash by. Am I missing a 0 in all the right places? :-)
>>>
>>>* main.prg
>>>DECLARE INTEGER ShellExecute IN "Shell32.dll" INTEGER, STRING, STRING, STRING, STRING, INTEGER
>>>
>>>* subroutine.prg
>>>=ShellExecute(0,"print",front_filename,"","",0)
>>
>>I don't think so, Todd. Of course, I declare the string as being passed by reference, and I do pass all parameters. Try that and see if that helps.
>
>I'm really really new at this, what parameters are missing? I assume they go where the empty quotes are, but I really don't know what information I am supposed to provide.
>
>"declare the strings as passed by reference" -- Don't understand. Passing by reference is done with the @ symbol, yes?

VFP actually passes all strings by reference to a DLL, but by declaring it and doing it this, we elminate any possibility of something there causing the problem. To do so:
DECLARE INTEGER ShellExecute IN Shell32;
  INTEGER hWnd, STRING @lpOperation,;
  STRING @lpFile, STRING @lpParameters,;
  STRING @lpDirectory, INTEGER nShowCmd
* lcFileName is the file
lcpath = JUSTPATH(lcFilename)
lcop = 'print'
lcparms = ""
lnresult = ShellExecute(0, @lcop, @lcFilename, @lcparms, @lcpath, 0)
See what this does.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform