Description
Renders one printable page to the DC.
Arguments
|
Name |
Type |
I/O |
Description |
|
hdcPrinter |
HDC |
In |
A Device Context for the destination printer. |
|
lPageNum |
Long Integer |
In |
The 1-based page number to print. |
|
bPreview |
Boolean |
In |
Indicates whether this is a Print Preview rendering or a rendering targeted at the printer. |
Return Value
Long Integer: a status value which may be one of the following.
|
0 |
PRINTER_OK |
Success |
|
-1 |
PRINTERR_BAD_DC |
The DC passed in was Null or bad. |
|
-2 |
PRINTERR_BAD_PAGERECT |
The PageRect specified had a top left corner that was less than (0, 0) or was specified with values that would yield an empty page, for example(50, 50, 500, 50). |
|
-3 |
PRINTERR_BAD_HTMLPAGE |
No HTML page loaded (internal error). |
|
-4 |
PRINTERR_BAD_PAGENUM |
The page number passed to PrintToDC was less than 0 or greater than the maximum number of pages returned by a previous call to the Paginate2 method. |
|
-5 |
PRINTERR_BAD_PAGETABLE |
There was no page table entry for the page number specified (internal error). |
|
-6 |
PRINTERR_BAD_PRINTER |
The printer specified does not support bitmap graphics. |
Remarks
Container applications call this method in order to print a given page. The Webster control prints the page and returns. It is the container’s responsibility to cycle through pages 1 through N in order to print all pages specified by the user. This support is built into the framework for MFC applications. MFC container applications should simply call CWebster1::OnPrint() from their CMyView::OnPrint() method as supplied by the framework.