Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printscreen DLL call works form 1 location, not from another
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Printscreen DLL call works form 1 location, not from another
Miscellaneous
Thread ID:
01138814
Message ID:
01138814
Views:
61
The following code used to dump a print screen image to the printer works fine when i run the VFP6 exe directly (not via a launcher), when i am current in the folder where the EXE was built. However, if i run the vfp exe from a launcher program (which copies the exe to a diff folder and then sets paths differently than if run as a "non-launcher" user), it errors with:
Cannot load 32-bit DLL "C:\mycurrentlauncherpathlocation\DIBAPI32.DLL"
What in the api calls below makes it a pathing issue of sorts? Or is it something else? Again it works fine on my machine calling the vfp exe from one location, but errors when called from the "workstation launcher" location (on the same machine). Here is the code.
DECLARE INTEGER GetDesktopWindow IN Win32api

DECLARE INTEGER PrintWindow IN DibApi32 ;
INTEGER HWnd, ;
INTEGER fPrintArea, ;
INTEGER fPrintOpt, ;
INTEGER wxScale, ;
INTEGER wyScale, ;
STRING @ szJobName

LOCAL nRetVal,cJobName && title you want to show when printing
cJobName = 'Printing...' && or whatever - this could be passed in as a parameter, also.
nRetVal = PrintWindow(GetDesktopWindow(),1,1,0,0,@cJobName)
IF nRetVal != 0
   IF nRetVal != 6 && 6 = User canceled printing
      MESSAGEBOX("error..... blah blah")
   ENDIF
ENDIF
Next
Reply
Map
View

Click here to load this message in the networking platform