Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the Selprint Method of a RichText Control
Message
De
19/03/1999 17:07:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00199808
Message ID:
00200007
Vues:
19
>I am sure this has been answered before but I missed it.
>
>I need to use the selprint function of a RichText Control.
>Unfortunately it requires the following
>
>hdc -- Thedevice context of the device you plan to use to print the
>contents of the control.
>
>and
>
>Note If you use the Printer object as the destination of the text
>from the RichTextBox control, you must first initialize the device
>context of the Printer object by printing something like a zero-length
>string.
>
>Assuming I have the name of the printer or I just want to print to the
>default printer.
>
>What are the api calls to get the hdc and to send through a zero
>length string?
>
>Thanks in advance.
>
>Jacob Bruner
>ClassyComponents
>Jacob@ClassyComponents.Com
declare integer CreateDC in Win32API ;
    string @ lpszDriver,	;
    string @ lpszDevice,	;
    string @ lpszOutput,	;
    string @ lpInitData
declare integer DeleteDC in Win32API ;
    integer hDc
declare integer GetDeviceCaps in Win32API ;
    integer  hdc, integer  nIndex

#define DRIVERVERSION 0   
#define TECHNOLOGY    2   

lpszDriver="WINSPOOL"
lpszDevice=getprinter()
hDC = CreateDC(lpszDriver, lpszDevice, 0, 0)
? hDc                        && If succesfull not NULL
? GetDeviceCaps(hDC, DRIVERVERSION)
? GetDeviceCaps(hDC, TECHNOLOGY) && 2 Rasterprinter 0 Vectorplotter
=DeleteDC(hDC)
This works and gets hDC but still I can't use selprint. MS KB says you cannot print under Win95 but WinNT and under investigation. June 18, 1997 Article ID: Q170126 (I don't have newer). Feedback me if you succeed :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform