这些对象中,那些需要释放,否则会内存泄露?为什么?说明白点,我笨 谢谢
1:m_Font m_Font.CreatePointFont(350, "Arial ");
m_ctrlEditCur.SetFont(&m_Font);
2: p_Wnd CWnd* pWnd = (CButton*)GetDlgItem(IDC_STOP);
pWnd-> EnableWindow(FALSE);
3: dc void CTradexDlg::OnPaint()
{ ......
CPaintDC dc(this); // 这是MFC自动生成的,我没添加任何语句,可我
// 没见到释放DC的语句阿?
......
}
4:hbitmap HBITMAP hbitmap1=(HBITMAP)::LoadBitmap(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_GREEN));
CStatic* pStatic1 =(CStatic*) GetDlgItem(IDC_STATIC_CV);
pStatic1-> ModifyStyle(0, SS_BITMAP|SS_CENTERIMAGE);
pStatic1-> SetBitmap(hbitmap1);
5:pComboBox
CComboBox* pComboBox1=(CComboBox*)GetDlgItem(IDC_COMBO1);
谢谢啦....我很急的!
[解决办法]
font.DeleteObject();
[解决办法]
LoadBitmap需要和DeleteObject()对应