Information générale
Catégorie:
Contrôles ActiveX en VFP
Hi Stephane...
To avoid the error error, you need to employ an error trapping mechanism. The fact that the error, or more accurately the exception occurs is importance since it is the only way you know if the user pressed the Error Button. I wrote a fairly extensive article on this in FoxTalk about 2 years ago.
I sent you my RTF stuff, which should help you with respect to the error handling strategy.
With respect to not showing the ShowPrinter Dialog, Christof Lange had some API code. I however, never got it to work reliably. The only consistient behavior I achieved was with the common dialog control. If we could reliably create a printer device context in VFP without the Common Dialog Control, well, that would be nice!!
Good Luck..
>I am trying to print the content of the rich text box, here is how i do it:
>
>
>oCommonDialog.Flags = 0x100
>oCommonDialog.ShowPrinter
>oRichTextBox.SelPrint(oCommonDialog.hdc)
>
>
>It Works fine but if the users press cancel on showPrinter(), i get an invalid hdc error message. I have 2 questions:
>
>1. How could i avoid the error message ?
>2. How could i print without showing the ShowPrinter() Dialog ?
>
>Thanks
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement