Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with PrintDesktop() using DibApi32.DLL
Message
From
08/02/2000 14:47:42
Dennis Schuette
Customized Business Services, Llc
Yuma, Arizona, United States
 
 
To
03/02/2000 19:27:05
Dennis Schuette
Customized Business Services, Llc
Yuma, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00327060
Message ID:
00329082
Views:
23
The fix was to add

clear dlls

just before the 'return' at the bottom of the PrintWindow procedure. I can now call this procedure as often as I need.

Will this affect anything else I am doing?

Denis Schuette
McElhaney Cattle Co.

>*!* *************************************************************
>*!* PrintDesktop - Prints the entire VFP Desktop
>*!* Provided by Steven Ruhl, via www.levelextreme.com
>*!* *************************************************************
>PROCEDURE PrintDesktop
> PrintWindow(MainhWnd(), "PRINT VFP Desktop")
> RETURN
>
>
>*!* *************************************************************
>*!* PrintWindow - Print a window
>**!
>*!* Paremeters:
>*!* tnHWnd Window handle
>*!* tcJobName Print Job Name
>*!*
>*!* Provided by Steven Ruhl, via www.levelextreme.com
>*!* *************************************************************
>PROCEDURE PrintWindow
> LPARAMETERS tnHWnd, tcJobName
>
> LOCAL lcJobName && Print job name
> LOCAL lnRetVal && Return value from API functions
>
> DECLARE INTEGER PrintWindow IN DibApi32 ;
> INTEGER HWnd, ;
> INTEGER fPrintArea, ;
> INTEGER fPrintOpt, ;
> INTEGER wxScale, ;
> INTEGER wyScale, ;
> STRING @ szJobName
>
> *!* Print entire window or just client area
> #DEFINE PW_WINDOW 1
> #DEFINE PW_CLIENT 2
>
> *!* How to size the printed image
> *!* PW_BESTFIT resizes to fill paper while retaining proportions
> *!* PW_STRETCHTOPAGE resizes to completely fill paper, distorts proportions
> *!* PR_SCALE scale print size
> #DEFINE PW_BESTFIT 1
> #DEFINE PW_STRETCHTOPAGE 2
> #DEFINE PW_SCALE 3
>
> *!* If you are not including FoxPro.H uncomment these lines
>*!* #DEFINE MB_ICONEXCLAMATION 48
>*!* #DEFINE MB_OK 0
>
> lcJobName = tcJobName + CHR(0)
> lnRetVal = PrintWindow( tnHWnd, PW_WINDOW, PW_STRETCHTOPAGE, 0, 0, @lcJobName)
> IF lnRetVal != 0
> IF lnRetVal != 6 && 6 = User canceled printing
> = MESSAGEBOX("Unable to print the window" + CRLF + ;
> "PrintWindow API call returned " + STR(lnRetVal), ;
> MB_ICONEXCLAMATION + MB_OK, ;
> "ERROR printing window, see Common.prg, PrintWindow()")
> ENDIF
> ENDIF
> RETURN
>
>
>***************************************
>
>The above code works correctly the first time I run =PrintDeskTop(), however the SECOND time I try to run it, I get a 'Too few arguments' error. I have to get completely out of VFP, then it works for one try again. I am using VFP 5.0a, NT 4.0 Workstation, SP4.
>
>Thanks in advance,
>Denis Schuette
>McElhaney Cattle Co.
Dennis Schuette
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform