Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GDIplusX
Message
From
21/11/2007 05:31:04
 
 
To
21/11/2007 05:24:47
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01269875
Message ID:
01270423
Views:
27
what are tha values for lnHorRes and lnVerRes?





>>>>I just downloaded it again from the VFPX site and ran it and it's the same story
>>>
>>>Thanks for confirming this.
>>do you have time to play with this now?
>>Or what time would be convenient for you?
>>
>>Peter
>
>
>I'd like to know just the source of the problem, if you tell me the values you get from PRTINFO(3) and PRTINFO(4), and PErform this other test too will be enough for this moment..
>
>Please perform this other test, using some codes based on A FAQ from Sergey Berezniker:
>
>
>
* API declarations for Getting Paper Size
>DECLARE INTEGER StartPage IN GDI32 INTEGER hdc
>DECLARE INTEGER EndPage IN GDI32 INTEGER hdc
>DECLARE INTEGER EndDoc IN GDI32 INTEGER hdc
>DECLARE INTEGER StartDoc IN GDI32 INTEGER hdc, STRING lpdi
>		
>DECLARE INTEGER OpenPrinter IN winspool.drv STRING  @pPrinterName, INTEGER @phPrinter, INTEGER pDefault
>DECLARE INTEGER ClosePrinter IN winspool.drv INTEGER hPrinter
>DECLARE LONG EnumForms IN winspool.drv AS EnumForms LONG hPrinter, LONG Level, LONG pForm, LONG cbBuf, LONG @pcbNeeded, LONG @ pcReturned
>DECLARE INTEGER HeapCreate IN WIN32API INTEGER dwOptions, INTEGER dwInitialSize, INTEGER dwMaxSize
>DECLARE INTEGER HeapAlloc IN WIN32API INTEGER hHeap, INTEGER dwFlags, INTEGER dwBytes
>DECLARE INTEGER HeapFree IN WIN32API INTEGER hHeap, INTEGER dwFlags, INTEGER lpMem
>DECLARE HeapDestroy IN WIN32API INTEGER hHeap
>
>
>LOCAL lhHeap
>* Allocate a heap
>m.lhHeap = HeapCreate(0, 4096*10, 0)
>		
>* Enumerate forms for default VFP printer
>LOCAL lhPrinter, lnNeeded, lnBuffer
>		
>* Open a printer
>m.lhPrinter = 0
>m.lnResult = OpenPrinter(@tcPrinterName, @lhPrinter, 0)
>		
>* Get the size of the buffer required to fit all forms in lnNeeded
>m.lnNeeded = 0
>=EnumForms(m.lhPrinter, 1,  0, 0, @lnNeeded, 0)
>		
>* Get the list of forms
>m.lnBuffer = HeapAlloc(m.lhHeap, 0, m.lnNeeded)
>=EnumForms(m.lhPrinter, 1, m.lnBuffer, @lnNeeded, @lnNeeded, 0)
>		
>* Get the information for the desired Paper ID obtained from PRTINFO(2)
>* The form attributes are stored in in thousandths of millimeters
>m.lnPointer = m.lnBuffer + (PRTINFO(2) - 1) * 32
>m.lnPageWidth  = CTOBIN(SYS(2600, (m.lnPointer+ 8), 4),"4RS") / 100
>m.lnPageHeight = CTOBIN(SYS(2600, (m.lnPointer+12), 4),"4RS") / 100
>		
>= HeapFree(m.lhHeap, 0, m.lnBuffer )
>= ClosePrinter(m.lhPrinter)
>		
>* Clear the Heap
>IF m.lhHeap <> 0
>   HeapDestroy(m.lhHeap)
>ENDIF
>		
>* Adjust page Width and Height
>m.lnPageWidth = (m.lnPageWidth / 100 / 2.54) * m.lnHorRes
>m.lnPageHeight = (m.lnPageHeight / 100 / 2.54) * m.lnVertRes
>
>? lnPageWidth, lnPageHeight
>
>
>Thanks in advance
>
>Cesar
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform