Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting hDC for a selected printer
Message
From
16/10/2009 10:46:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Getting hDC for a selected printer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Miscellaneous
Thread ID:
01429635
Message ID:
01429635
Views:
99
My VFP9 app uses VBPrinter.ocx to get a Device Context Handle (hDC) to a printer or PDF Driver, allowing users to select a driver and modify preferences before sending a non VFP Graphics output to the hDC for printing.

This has worked well until we install on 64bit Windows. The VBPrinter.OCX is not registering correctly with the result that an OLE Error message is displays, the object does not get created, and therefore none of its methods are available. I've concluded that this third party untility is not valid for 64bit so I need another method of achieving this. To recap, I use the following methods to find out or to set the Default Printer and the Orientation of the default printer. Once I've done this I use WinAPI functions to create a DC and get its handle (hDC).

DefaultPrinter = .ctrlPrinter.DeviceName
DefaultOrientation = .ctrlPrinter.Orientation

Can anyone recommend an alternative method?
Next
Reply
Map
View

Click here to load this message in the networking platform