Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating Reports Programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00533871
Message ID:
00775357
Vues:
17
Hi Nadya,

At one time I used ??? to send raw output to the printer for printing checks which were sized differently than standard letter size paper. After FoxPro was ported to windows, it became more and more difficult to use ??? to configure a printer, as windows insisted that everything being printed go through its print manager. Anyways, here the message:

From Leland:

Hi

I've placed a Richtx32.ocx activeX control on a Visual FoxPro 7 wizstyle form. I'm using the Richtx32.ocx editbox to display help from within am app. The richtx32.ocx uses pshelp.dictdata as its record source. Pshelp is the name of the Visual FoxPro 7 table, and dictdata is a memo field within the VFP7 table that holds the help text. It seems to be working well; however, I would like to print the text in the editbox. It is my understanding this can be done using the selprint() method. The selprint() method has the following properties:

*** ActiveX Control Method ***
LPARAMETERS lhdc, vstartdoc

The text is in a .rft format, so I need the activeX control to print it. Does anyone know what I should pass to the lhdc and vstartdoc parameters in order to print the rich text displayed in the editbox. I did a quick search of the web but didn't come up with anything.

Ed Rauh:

I can answer part of this - the lhdc, is the numeric handle of a Device Context - the device which will receive the output. In VB, the hDC is exposed by VB's Printer object; unfortunately, we don't get this natively within Visual FoxPro. You can obtain an hDC for a printer by calling the CreateDC() Windows API, as shown below:

DECLARE INTEGER CreateDC IN WIN32API ;
INTEGER lpszDriver, ;
STRING @ lpszDevice, ;
INTEGER lpszOutput, ;
INTEGER lpInitData
DECLARE INTEGER DeleteDC IN WIND32API INTEGER hDC
nHDC = CreateDC(0,"MyWinPrinterName",0,0)
*
* Use the hDC, and when finished with it:
*
=DeleteDC(nHDC)

In fact, the last argument, lpInitData, could be a pointer to a structure defining how the device context is to be set up; for a detailed discussion of the structure, see the MSDN documentation on the DEVMODE structure in the Platform SDK docs.

Leland says:

I not an expert on this API, but I did try it and was able to print the rtf formated text in the richtx32.ocx control. You could play around with this to see if it would do what you want. For purposes of my application, I finally decided to use the shellexec command to send the output to whatever default device was registered to work with rtf (e.g. word, notepad, etc).
Leland F. Jackson, CPA
Software - Master (TM)
smvfp@mail.smvfp.com
Software Master TM
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform