CClientDC( CWnd* pWnd );
throw( CResourceException );
Parameters
pWnd
The window whose client area the device context object will access.
Remarks
Constructs a CClientDC object that accesses the client area of the CWnd pointed to by pWnd. The constructor calls the Windows function GetDC.
An exception (of type CResourceException) is thrown if the Windows GetDC call fails. A device context may not be available if Windows has already allocated all of its available device contexts. Your application competes for the five common display contexts available at any given time under Windows.
Example
// Get a dc for a CWnd object pointer.
CClientDC dc(pWnd);
// Send my private massage.
::SendMessage(pWnd->m_hWnd, WM_MYMESSAGE, 0, 0);