Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Printer's Device Context Handle
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00088451
Message ID:
00088452
Vues:
30
>Greetings!
>
>We are using the Griffen Technologies TX Text Controller v5.52 and are having trouble printing. Apparently, the OCX needs to talk directly to the printer port and must have the integer handle for the printer device.
>
>The syntax would be something like:
>
> TXTextControl1.PrintDevice = Printer.hDC
> TXTextControl1.PrintPage(n)
>
>This OCX was designed with Visual Basic in mind and, from what I can see, VB can print by grabbing the device handle. Can FoxPro do this, too? Any assistance would be most appreciated. (We're also awaiting feedback from the developer.)
>
>Michael Reynolds
>herbalst@west.net

Try this:
DECLARE INTEGER CreateDC IN Win32API;
  STRING @lpszDriver, STRING @lpszDevice,;
  STRING @lpszOutput, STRING @lpInitData
hDC = CreateDC('WINSPOOL', lcPrinter, 0, 0)
In the above lcPrinter is the name of the printer (as it would appear in the first column of the array returned by APRINTERS()).

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform