Call this member function to get m_hDC, the output device context.
HDC GetSafeHdc( ) const;
A device context handle.
This member function also works with null pointers.
Header: afxwin.h