HDC LKSurface::Detach() { HDC hDC = _OutputDC; ReleaseAttribDC(); ReleaseTempDC(); _OutputDC = NULL; return hDC; }
HDC CDC::Detach() { HDC hDC = m_hDC; if (hDC != NULL) { CHandleMap* pMap = afxMapHDC(); // don't create if not exist if (pMap != NULL) pMap->RemoveHandle(m_hDC); } ReleaseAttribDC(); m_hDC = NULL; return hDC; }