下面是MSDN中的代码EnterCriticalSection(&CGDIThread::m_csGDILock);
CBrush* oldbrush;oldbrush = m_dc.SelectObject(&m_brush);
m_dc.Ellipse(m_rectPosition);
m_dc.SelectObject(oldbrush);
GdiFlush();
LeaveCriticalSection(&CGDIThread::m_csGDILock);我想问为什么一定要加下面三句,我注释他们结果没什么变化
EnterCriticalSection(&CGDIThread::m_csGDILock);
GdiFlush();
LeaveCriticalSection(&CGDIThread::m_csGDILock);