OnDestroy//消息处理函数不是点击×,才会相应吗?//怎么去掉if(1==bkMap)就会内存错误?void CJune22_tooltestDlg::OnDestroy(){CDialogEx::OnDestroy();// TODO: Add your message handler code hereif (1==bkMap){bkMap=0;pMemDC.SelectObject(pOldBitmap);pMemDC2.SelectObject(pOldBitmap2);pMemDC3.SelectObject(pOldBitmap3);pMemDC4.SelectObject(pOldBitmap4); }}
3 回答
四季花海
TA贡献1811条经验 获得超5个赞
改成下面这样试试
void CJune22_tooltestDlg::OnDestroy()
{
if (1==bkMap)
{
bkMap=0;
pMemDC.SelectObject(pOldBitmap);
pMemDC2.SelectObject(pOldBitmap2);
pMemDC3.SelectObject(pOldBitmap3);
pMemDC4.SelectObject(pOldBitmap4);
}
CDialogEx::OnDestroy();
// TODO: Add your message handler code here
}
慕妹3146593
TA贡献1820条经验 获得超9个赞
(1==bkMap)为真
{
bkMap=0;
pMemDC.SelectObject(pOldBitmap);
pMemDC2.SelectObject(pOldBitmap2);
pMemDC3.SelectObject(pOldBitmap3);
pMemDC4.SelectObject(pOldBitmap4);
}
才能执行,可能是只有(1==bkMap)为真时里面的各个值才有效。
- 3 回答
- 0 关注
- 1179 浏览
添加回答
举报
0/150
提交
取消