IPrintDialogServices::GetCurrentDevMode method (commdlg.h)
Fills a DEVMODE structure with information about the currently selected printer for use with PrintDlgEx.
Syntax
HRESULT GetCurrentDevMode(
LPDEVMODE pDevMode,
UINT *pcbSize
);
Parameters
pDevMode
Type: LPDEVMODE
A pointer to a buffer that receives a DEVMODE structure containing information about the currently selected printer.
pcbSize
Type: UINT*
On input, the variable specifies the size, in bytes, of the buffer pointed to by the lpDevMode parameter. On output, the variable contains the number of bytes written to lpDevMode.
If the size is zero on input, the function returns the required buffer size (in bytes) in pcbSize and does not use the lpDevMode buffer.
Return value
Type: HRESULT
If the method is successful, the return value is S_OK. If no printer is currently selected, the return value is S_OK, the value returned in pcbSize is zero, and the lpDevMode buffer is unchanged.
If an error occurs, the return value is a COM error code. For more information, see Error Handling.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | commdlg.h (include Windows.h) |
DLL | Comdlg32.dll |
See also
Conceptual
Reference