WinHand.cpp Line 199 错误 WinHand.cpp Line 218 错误

发生错误的一种可能的原因:
程序中申请了DC的指针:
CDC* pDC = this->GetDC();
在使用完后调用了删除函数:
pDC->DeleteDC();
问题在这儿,在获取的对象的DC后,不要轻易使用用删除函数,应改成:
ReleaseDC(pDC);

除非是自己创建的DC,否则不要删除,发生这类错误一般很难定位。



解决 pDC->DeleteDC(); 的地方都改成  ReleaseDC(pDC);  

你可能感兴趣的:(WinHand.cpp Line 199 错误 WinHand.cpp Line 218 错误)