General information
Category:
ActiveX controls in VFP
Title:
Getting hDC for a selected printer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only