Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Printer's Device Context Handle
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00088451
Message ID:
00088452
Views:
35
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform