Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing a Rich Text document
Message
De
01/05/1997 10:39:37
 
 
À
22/04/1997 18:05:21
Renato De Giovanni
Via Fractal Information Systems
São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00028890
Message ID:
00030446
Vues:
58
Well, I figured out how to print from the Rich Text Control. Then discovered that it was not powerful enough for our needs. But, in case it is what you want, here is how we finally got it to work....

--------------

* Print Rich Text from the Rich Text Control.
* The trick to this routine is creating your own device context
* rather than using the one already defined.
PRIVATE lnhDC
* Register API functions to get a device context
DECLARE LONG CreateDC IN GDI32 ;
STRING, STRING, STRING, CHAR
DECLARE LONG DeleteDC IN GDI32 LONG

* Get a device context for the current printer
lnHDC = CreateDC("", SET("PRINTER",2), .NULL.)

* Use the printer device context just created to print the information
* in your Rich Text Control.
* NOTE: The Rich Text Control name can be anything. We just
* called it "RichTextBox1" for testing purposes
Thisform.RichTextBox1.SelPrint(lnhDC)

* Now remove the printer device context.
DeleteDC(lnhDC)

---------------


>>I am trying to print a Rich Text document from within Foxpro, as well as display the document. I started by using the RichText ActiveX Control, which displays the document with no problem. Now I want to print the document but I need the printer handle to do it using this control. Anybody know how to get a printer handle? Or...does anyone know of a better way to print an RTF within Foxpro?
>
>Hi Eugene,
>
>If you find out an answer to your question, please let me also know about it...
>We're facing the same challenge over here and the only way we had discovered to do that is using the RichText Control Method called "SelPrint" (but that's not enough for us here).
>
>Thanks,
>
>Renato.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform