::DeleteObject()的问题;
对话框中有一按钮(资源属性有Bitmap),需显示一位图,我在
OnInitDialog()中有
HBITMAP bitbotton=::LoadBitmap()装入一位图,再
((CButton *)GetDlgItem(ID))->SetBitmap(bitbotton)
能正常显示,但我觉得有人说LoadBitmap后应用DeleteObject,
故我在后面再加了:
::DeleteObject(bitbotton);
位图就不能被显示了,我觉得很奇怪,问:
(1)为什么?
(2)我也在其它地方也Load用完后Delete,却一切正常?
(3)Load后一定要Delete吗,为什么?
(4)在此处,我用:
CBitmap bitbotton;
bitbotton.LoadBitmap()
((CButton *)GetDlgItem(ID))->SetBitmap((HBITMAP)bitbotton)
竞显示不出位图来?