Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting hDC for a selected printer
Message
De
16/10/2009 10:46:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Getting hDC for a selected printer
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Divers
Thread ID:
01429635
Message ID:
01429635
Vues:
98
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform