>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 my app. The richtx32.ocx uses pshelp.dictdata as its records source. Pshelp is the name of the VFP 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 the 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 addressing this.
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 VFP. 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 WIN32API INTEGER hDC
nHDC = CreateDC(0,"MyWinPrinterName",0,0)
=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.