Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Richtx32.OCX selprint property
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00719122
Message ID:
00719131
Views:
15
This message has been marked as the solution to the initial question of the thread.
>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)
*
*  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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform