Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using the Selprint Method of a RichText Control
Message
From
16/09/1999 11:49:10
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
19/03/1999 17:07:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00199808
Message ID:
00265501
Views:
15
>>I am sure this has been answered before but I missed it.
>>
>>I need to use the selprint function of a RichText Control.
>>Unfortunately it requires the following
>>
>>hdc -- Thedevice context of the device you plan to use to print the
>>contents of the control.
>>
>>and
>>
>>Note If you use the Printer object as the destination of the text
>>from the RichTextBox control, you must first initialize the device
>>context of the Printer object by printing something like a zero-length
>>string.
>>
>>Assuming I have the name of the printer or I just want to print to the
>>default printer.

>
declare integer CreateDC in Win32API ;
>    string @ lpszDriver,	;
>    string @ lpszDevice,	;
>    string @ lpszOutput,	;
>    string @ lpInitData
>declare integer DeleteDC in Win32API ;
>    integer hDc
>declare integer GetDeviceCaps in Win32API ;
>    integer  hdc, integer  nIndex
>
>#define DRIVERVERSION 0
>#define TECHNOLOGY    2
>
>lpszDriver="WINSPOOL"
>lpszDevice=getprinter()
>hDC = CreateDC(lpszDriver, lpszDevice, 0, 0)
>? hDc                        && If succesfull not NULL
>? GetDeviceCaps(hDC, DRIVERVERSION)
>? GetDeviceCaps(hDC, TECHNOLOGY) && 2 Rasterprinter 0 Vectorplotter
>=DeleteDC(hDC)
This works and gets hDC but still I can't use selprint. MS KB says you cannot print under Win95 but WinNT and under investigation. June 18, 1997 Article ID: Q170126 (I don't have newer). Feedback me if you succeed :)
>Cetin

I'm sort of late-jumping into this thread, but now I need it, so I'd like to know if anything worked, short of running a dummy instance of CommonDialogs (while that would still work OK for me if it wouldn't show onscreen).

So, did anyone get this working?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform