CDC::ResetDC

Call this member function to update the device context wrapped by the CDC object.

BOOL ResetDC(
   const DEVMODE* lpDevMode 
);

Parameters

  • lpDevMode
    A pointer to a Windows DEVMODE structure.

Return Value

Nonzero if the function is successful; otherwise 0.

Remarks

The device context is updated from the information specified in the Windows DEVMODE structure. This member function only resets the attribute device context.

An application will typically use the ResetDC member function when a window processes a WM_DEVMODECHANGE message. You can also use this member function to change the paper orientation or paper bins while printing a document.

You cannot use this member function to change the driver name, device name, or output port. When the user changes the port connection or device name, you must delete the original device context and create a new device context with the new information.

Before you call this member function, you must ensure that all objects (other than stock objects) that had been selected into the device context have been selected out.

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

CDC::m_hAttribDC

ResetDC

WM_DEVMODECHANGE

DEVMODE

Other Resources

CDC Members