You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mfc/reference/cprintdialogex-class.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,15 +61,15 @@ class CPrintDialogEx : public CCommonDialog
61
61
62
62
To use a `CPrintDialogEx` object, first create the object using the `CPrintDialogEx` constructor. Once the dialog box has been constructed, you can set or modify any values in the [m_pdex](#m_pdex) structure to initialize the values of the dialog box's controls. The `m_pdex` structure is of type [PRINTDLGEX](http://msdn.microsoft.com/library/windows/desktop/ms646844). For more information on this structure, see the Windows SDK.
63
63
64
-
If you do not supply your own handles in `m_pdex` for the **hDevMode** and **hDevNames** members, be sure to call the Windows function **GlobalFree** for these handles when you are done with the dialog box.
64
+
If you do not supply your own handles in `m_pdex` for the `hDevMode` and `hDevNames` members, be sure to call the Windows function `GlobalFree` for these handles when you are done with the dialog box.
65
65
66
66
After initializing the dialog box controls, call the `DoModal` member function to display the dialog box and allow the user to select print options. When `DoModal` returns, you can determine whether the user selected the OK, Apply, or Cancel button.
67
67
68
68
If the user pressed OK, you can use `CPrintDialogEx`'s member functions to retrieve the information input by the user.
69
69
70
70
The `CPrintDialogEx::GetDefaults` member function is useful for retrieving the current printer defaults without displaying a dialog box. This method requires no user interaction.
71
71
72
-
You can use the Windows **CommDlgExtendedError** function to determine whether an error occurred during initialization of the dialog box and to learn more about the error. For more information on this function, see the Windows SDK.
72
+
You can use the Windows `CommDlgExtendedError` function to determine whether an error occurred during initialization of the dialog box and to learn more about the error. For more information on this function, see the Windows SDK.
73
73
74
74
For more information on using `CPrintDialogEx`, see [Common Dialog Classes](../../mfc/common-dialog-classes.md).
75
75
@@ -104,7 +104,7 @@ CPrintDialogEx(
104
104
105
105
### Parameters
106
106
*dwFlags*
107
-
One or more flags you can use to customize the settings of the dialog box, combined using the bitwise OR operator. For example, the **PD_ALLPAGES** flag sets the default print range to all pages of the document. See the [PRINTDLGEX](http://msdn.microsoft.com/library/windows/desktop/ms646844) structure in the Windows SDK for more information on these flags.
107
+
One or more flags you can use to customize the settings of the dialog box, combined using the bitwise OR operator. For example, the PD_ALLPAGES flag sets the default print range to all pages of the document. See the [PRINTDLGEX](http://msdn.microsoft.com/library/windows/desktop/ms646844) structure in the Windows SDK for more information on these flags.
108
108
109
109
*pParentWnd*
110
110
A pointer to the dialog box's parent or owner window.
@@ -123,7 +123,7 @@ HDC CreatePrinterDC();
123
123
Handle to the newly created printer device context.
124
124
125
125
### Remarks
126
-
The returned DC is also stored in the **hDC** member of [m_pdex](#m_pdex).
126
+
The returned DC is also stored in the `hDC` member of [m_pdex](#m_pdex).
127
127
128
128
This DC is assumed to be the current printer DC, and any other previously obtained printer DCs must be deleted. This function can be called, and the resulting DC used, without ever displaying the Print dialog box.
129
129
@@ -142,7 +142,7 @@ virtual INT_PTR DoModal();
142
142
143
143
After calling `DoModal`, you can call other member functions to retrieve the settings or information input by the user into the dialog box.
144
144
145
-
If the **PD_RETURNDC** flag is used when calling `DoModal`, a printer DC will be returned in the **hDC** member of [m_pdex](#m_pdex). This DC must be freed with a call to [DeleteDC](http://msdn.microsoft.com/library/windows/desktop/dd183533) by the caller of `CPrintDialogEx`.
145
+
If the PD_RETURNDC flag is used when calling `DoModal`, a printer DC will be returned in the `hDC` member of [m_pdex](#m_pdex). This DC must be freed with a call to [DeleteDC](http://msdn.microsoft.com/library/windows/desktop/dd183533) by the caller of `CPrintDialogEx`.
Call this function after calling `DoModal` to retrieve the number of copies requested.
@@ -162,14 +162,14 @@ BOOL GetDefaults();
162
162
```
163
163
164
164
### Return Value
165
-
**TRUE** if successful, otherwise **FALSE**.
165
+
TRUE if successful, otherwise FALSE.
166
166
167
167
### Remarks
168
168
Creates a printer device context (DC) from the [DEVMODE](http://msdn.microsoft.com/library/windows/desktop/dd183565) and [DEVNAMES](../../mfc/reference/devnames-structure.md) structures.
169
169
170
-
`GetDefaults` does not display the Print property sheet. Instead, it sets the **hDevNames** and **hDevMode** members of [m_pdex](#m_pdex) to handles to the [DEVMODE](http://msdn.microsoft.com/library/windows/desktop/dd183565) and [DEVNAMES](../../mfc/reference/devnames-structure.md) structures that are initialized for the system default printer. Both **hDevNames** and **hDevMode** must be NULL, or `GetDefaults` fails.
170
+
`GetDefaults` does not display the Print property sheet. Instead, it sets the `hDevNames` and `hDevMode` members of [m_pdex](#m_pdex) to handles to the [DEVMODE](http://msdn.microsoft.com/library/windows/desktop/dd183565) and [DEVNAMES](../../mfc/reference/devnames-structure.md) structures that are initialized for the system default printer. Both `hDevNames` and `hDevMode` must be NULL, or `GetDefaults` fails.
171
171
172
-
If the **PD_RETURNDC** flag is set, this function will not only return **hDevNames** and **hDevMode** (located in **m_pdex.hDevNames** and **m_pdex.hDevMode**) to the caller, but will also return a printer DC in **m_pdex.hDC**. It is the responsibility of the caller to delete the printer DC and call the Windows [GlobalFree](http://msdn.microsoft.com/library/windows/desktop/aa366579) function on the handles when you are finished with the `CPrintDialogEx` object.
172
+
If the PD_RETURNDC flag is set, this function will not only return `hDevNames` and `hDevMode` (located in `m_pdex.hDevNames` and `m_pdex.hDevMode`) to the caller, but will also return a printer DC in `m_pdex.hDC`. It is the responsibility of the caller to delete the printer DC and call the Windows [GlobalFree](http://msdn.microsoft.com/library/windows/desktop/aa366579) function on the handles when you are finished with the `CPrintDialogEx` object.
Call this function after calling [DoModal](#domodal) to retrieve the name of the currently selected printer, or after calling [GetDefaults](#getdefaults) to retrieve the name of the default printer.
@@ -250,7 +250,7 @@ BOOL PrintAll() const;
250
250
```
251
251
252
252
### Return Value
253
-
**TRUE** if all pages in the document are to be printed; otherwise **FALSE**.
253
+
TRUE if all pages in the document are to be printed; otherwise FALSE.
Call this function after calling `DoModal` to determine whether to print only a range of pages in the document.
@@ -280,10 +280,10 @@ BOOL PrintRange() const;
280
280
```
281
281
282
282
### Return Value
283
-
**TRUE** if only a range of pages in the document are to be printed; otherwise **FALSE**.
283
+
TRUE if only a range of pages in the document are to be printed; otherwise FALSE.
284
284
285
285
### Remarks
286
-
The specified page ranges can be determined from [m_pdex](#m_pdex) (see **nPageRanges**, **nMaxPageRanges**, and **lpPageRanges** in the [PRINTDLGEX](http://msdn.microsoft.com/library/windows/desktop/ms646844) structure in the Windows SDK).
286
+
The specified page ranges can be determined from [m_pdex](#m_pdex) (see `nPageRanges`, `nMaxPageRanges`, and `lpPageRanges` in the [PRINTDLGEX](http://msdn.microsoft.com/library/windows/desktop/ms646844) structure in the Windows SDK).
Copy file name to clipboardExpand all lines: docs/mfc/reference/cprintinfo-structure.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ struct CPrintInfo
62
62
63
63
A `CPrintInfo` object is passed between the framework and your view class during the printing process and is used to exchange information between the two. For example, the framework informs the view class which page of the document to print by assigning a value to the `m_nCurPage` member of `CPrintInfo`; the view class retrieves the value and performs the actual printing of the specified page.
64
64
65
-
Another example is the case in which the length of the document is not known until it is printed. In this situation, the view class tests for the end of the document each time a page is printed. When the end is reached, the view class sets the `m_bContinuePrinting` member of `CPrintInfo` to **FALSE**; this informs the framework to stop the print loop.
65
+
Another example is the case in which the length of the document is not known until it is printed. In this situation, the view class tests for the end of the document each time a page is printed. When the end is reached, the view class sets the `m_bContinuePrinting` member of `CPrintInfo` to FALSE; this informs the framework to stop the print loop.
66
66
67
67
`CPrintInfo` is used by the member functions of `CView` listed under "See Also." For more information about the printing architecture provided by the Microsoft Foundation Class Library, see [Frame Windows](../../mfc/frame-windows.md) and [Document/View Architecture](../../mfc/document-view-architecture.md) and the articles [Printing](../../mfc/printing.md) and [Printing: Multipage Documents](../../mfc/multipage-documents.md).
68
68
@@ -130,7 +130,7 @@ UINT GetOffsetPage() const;
130
130
The number of pages preceding the first page of a DocObject item being printed in a combined DocObject print job.
131
131
132
132
### Remarks
133
-
This value is referenced by the **m_nOffsetPage** member. The first page of your document will be numbered the **m_nOffsetPage** value + 1 when printed as a DocObject with other active documents. The **m_nOffsetPage** member is valid only if the **m_bDocObject** value is **TRUE**.
133
+
This value is referenced by the `m_nOffsetPage` member. The first page of your document will be numbered the `m_nOffsetPage` value + 1 when printed as a DocObject with other active documents. The `m_nOffsetPage` member is valid only if the `m_bDocObject` value is TRUE.
134
134
135
135
## <aname="gettopage"></a> CPrintInfo::GetToPage
136
136
Call this function to retrieve the number of the last page to be printed.
@@ -151,75 +151,75 @@ UINT GetToPage() const;
151
151
Contains a flag indicating whether the framework should continue the print loop.
152
152
153
153
### Remarks
154
-
If you are doing print-time pagination, you can set this member to **FALSE** in your override of `CView::OnPrepareDC` once the end of the document has been reached. You do not have to modify this variable if you have specified the length of the document at the beginning of the print job using the `SetMaxPage` member function. The `m_bContinuePrinting` member is a public variable of type **BOOL**.
154
+
If you are doing print-time pagination, you can set this member to FALSE in your override of `CView::OnPrepareDC` once the end of the document has been reached. You do not have to modify this variable if you have specified the length of the document at the beginning of the print job using the `SetMaxPage` member function. The `m_bContinuePrinting` member is a public variable of type BOOL.
155
155
156
156
## <aname="m_bdirect"></a> CPrintInfo::m_bDirect
157
-
The framework sets this member to **TRUE** if the Print dialog box will be bypassed for direct printing; **FALSE** otherwise.
157
+
The framework sets this member to TRUE if the Print dialog box will be bypassed for direct printing; FALSE otherwise.
158
158
159
159
### Remarks
160
-
The Print dialog is normally bypassed when you print from the shell or when printing is done using the command ID **ID_FILE_PRINT_DIRECT**.
160
+
The Print dialog is normally bypassed when you print from the shell or when printing is done using the command ID ID_FILE_PRINT_DIRECT.
161
161
162
162
You normally don't change this member, but if you do change it, change it before you call [CView::DoPreparePrinting](../../mfc/reference/cview-class.md#doprepareprinting) in your override of [CView::OnPreparePrinting](../../mfc/reference/cview-class.md#onprepareprinting).
Contains a flag indicating whether the document is being previewed.
172
172
173
173
### Remarks
174
-
This is set by the framework depending on which command the user executed. The Print dialog box is not displayed for a print-preview job. The **m_bPreview** member is a public variable of type **BOOL**.
174
+
This is set by the framework depending on which command the user executed. The Print dialog box is not displayed for a print-preview job. The `m_bPreview` member is a public variable of type BOOL.
175
175
176
176
## <aname="m_dwflags"></a> CPrintInfo::m_dwFlags
177
177
Contains a combination of flags specifying DocObject printing operations.
178
178
179
179
### Remarks
180
-
Valid only if data member **m_bDocObject** is **TRUE**.
180
+
Valid only if data member `m_bDocObject` is TRUE.
181
181
182
182
The flags can be one or more of the following values:
You can use this to store printing-specific data that you do not want to store in your view class. The **m_lpUserData** member is a public variable of type **LPVOID**.
202
+
You can use this to store printing-specific data that you do not want to store in your view class. The `m_lpUserData` member is a public variable of type LPVOID.
The framework calls `CView::OnPrepareDC` and `CView::OnPrint` once for each page of the document, specifying a different value for this member each time; its values range from the value returned by `GetFromPage` to that returned by `GetToPage`. Use this member in your overrides of `CView::OnPrepareDC` and `CView::OnPrint` to print the specified page of the document.
209
209
210
-
When preview mode is first invoked, the framework reads the value of this member to determine which page of the document should be previewed initially. You can set the value of this member in your override of `CView::OnPreparePrinting` to maintain the user's current position in the document when entering preview mode. The `m_nCurPage` member is a public variable of type **UINT**.
210
+
When preview mode is first invoked, the framework reads the value of this member to determine which page of the document should be previewed initially. You can set the value of this member in your override of `CView::OnPreparePrinting` to maintain the user's current position in the document when entering preview mode. The `m_nCurPage` member is a public variable of type UINT.
Indicates the job number assigned by the operating system for the current print job.
214
214
215
215
### Remarks
216
-
This value may be **SP_ERROR** if the job hasn't yet printed (that is, if the `CPrintInfo` object is newly constructed and has not yet been used to print), or if there was an error in starting the job.
216
+
This value may be SP_ERROR if the job hasn't yet printed (that is, if the `CPrintInfo` object is newly constructed and has not yet been used to print), or if there was an error in starting the job.
Contains the number of pages preceding the first page of a particular DocObject in a combined DocObject print job.
@@ -234,13 +234,13 @@ UINT GetToPage() const;
234
234
Specifies the usable drawing area of the page in logical coordinates.
235
235
236
236
### Remarks
237
-
You may want to refer to this in your override of `CView::OnPrint`. You can use this member to keep track of what area remains usable after you print headers, footers, and so on. The **m_rectDraw** member is a public variable of type `CRect`.
237
+
You may want to refer to this in your override of `CView::OnPrint`. You can use this member to keep track of what area remains usable after you print headers, footers, and so on. The `m_rectDraw` member is a public variable of type `CRect`.
Contains a format string used to display the page numbers during print preview; this string consists of two substrings, one for single-page display and one for double-page display, each terminated by a '\n' character.
241
241
242
242
### Remarks
243
-
The framework uses "Page %u\nPages %u-%u\n" as the default value. If you want a different format for the page numbers, specify a format string in your override of `CView::OnPreparePrinting`. The **m_strPageDesc** member is a public variable of type `CString`.
243
+
The framework uses "Page %u\nPages %u-%u\n" as the default value. If you want a different format for the page numbers, specify a format string in your override of `CView::OnPreparePrinting`. The `m_strPageDesc` member is a public variable of type `CString`.
0 commit comments