我的程序中定义了一些个对象,一开始对象不多运行的还好,可在增加对象时,程序编译没问题,可运行时就出了问题,多一个对象的话,运行关闭时报告有严重问题,再多一个对象编译还是没问题,运行时就出问题了,说有严重问题,弹出的对话框内容是:debug assertion failed!
File:dbgheap.c
Line:1044
Expression: _CrtIsValidHeapPointer(pUserData)
还有一个错误对话框:Debug error!
DAMAGE: before (null)block(#1245104)at 0x0012BB78.
我的程序对话框类定义的对象如下:
class CSetWinDlg : public CDialog
{
// Construction
public:
CSetWinDlg(CWnd* pParent = NULL); // standard constructor
void OnUpdateFlush(CMenu *pMenu);
BOOL editcheck; CFont m_font;
// Dialog Data
//{{AFX_DATA(CSetWinDlg)
enum { IDD = IDD_SETWIN_DIALOG };
CPPHtmlStatic m_com1;//常规管理文本控件的控制对象
CPPHtmlStatic m_com2;
CPPHtmlStatic m_com3;
CPPHtmlStatic m_USBKEY1;
CPPHtmlStatic m_group1;//组框的控制对象
CPPHtmlStatic m_group2;
CPPHtmlStatic m_group3;
CPPHtmlStatic m_Seting;
CPPHtmlStatic m_Container;
CPPHtmlStatic m_common;
CPPHtmlStatic m_Title1; CXPStyleButtonST m_Close;//关闭按钮的控制对象按钮的风格为XP
CXPStyleButtonST m_OK;
CXPStyleButtonST m_Cancel;
CXPStyleButtonST m_Application;
CThemeHelperST m_Theme;
HICON m_hColorIcon;
CHyperLink m_hylink3;
CHyperLink m_hylink4;
Ccommon *com;
Manage *man;
CUsbkey *usb;
NOTIFYICONDATA m_tnid; //设置系统托盘
BCMenu m_menu;
PNOTIFYICONDATA m_ptnid;
//}}AFX_DATA // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSetWinDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL// Implementation
protected:
HICON m_hIcon; // Generated message map functions
//{{AFX_MSG(CSetWinDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSeting();
virtual void OnCancel();
afx_msg void Oncom1();
afx_msg void Oncom2();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnDestroy();
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI); //}}AFX_MSG
private:
CPPHtmlStatic m_Tit1;
CPPHtmlStatic m_Tit2;
// CPPHtmlStatic m_Tit3;
// CHyperLink m_Tit2;
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_SETWINDLG_H__A6FC14C6_9408_41A4_B9AC_9827C7FB7D7B__INCLUDED_)
File:dbgheap.c
Line:1044
Expression: _CrtIsValidHeapPointer(pUserData)
还有一个错误对话框:Debug error!
DAMAGE: before (null)block(#1245104)at 0x0012BB78.
我的程序对话框类定义的对象如下:
class CSetWinDlg : public CDialog
{
// Construction
public:
CSetWinDlg(CWnd* pParent = NULL); // standard constructor
void OnUpdateFlush(CMenu *pMenu);
BOOL editcheck; CFont m_font;
// Dialog Data
//{{AFX_DATA(CSetWinDlg)
enum { IDD = IDD_SETWIN_DIALOG };
CPPHtmlStatic m_com1;//常规管理文本控件的控制对象
CPPHtmlStatic m_com2;
CPPHtmlStatic m_com3;
CPPHtmlStatic m_USBKEY1;
CPPHtmlStatic m_group1;//组框的控制对象
CPPHtmlStatic m_group2;
CPPHtmlStatic m_group3;
CPPHtmlStatic m_Seting;
CPPHtmlStatic m_Container;
CPPHtmlStatic m_common;
CPPHtmlStatic m_Title1; CXPStyleButtonST m_Close;//关闭按钮的控制对象按钮的风格为XP
CXPStyleButtonST m_OK;
CXPStyleButtonST m_Cancel;
CXPStyleButtonST m_Application;
CThemeHelperST m_Theme;
HICON m_hColorIcon;
CHyperLink m_hylink3;
CHyperLink m_hylink4;
Ccommon *com;
Manage *man;
CUsbkey *usb;
NOTIFYICONDATA m_tnid; //设置系统托盘
BCMenu m_menu;
PNOTIFYICONDATA m_ptnid;
//}}AFX_DATA // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSetWinDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL// Implementation
protected:
HICON m_hIcon; // Generated message map functions
//{{AFX_MSG(CSetWinDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSeting();
virtual void OnCancel();
afx_msg void Oncom1();
afx_msg void Oncom2();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnDestroy();
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI); //}}AFX_MSG
private:
CPPHtmlStatic m_Tit1;
CPPHtmlStatic m_Tit2;
// CPPHtmlStatic m_Tit3;
// CHyperLink m_Tit2;
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_SETWINDLG_H__A6FC14C6_9408_41A4_B9AC_9827C7FB7D7B__INCLUDED_)
CPPHtmlStatic m_Tit1; //增加着一个对象时,运行后报警有严重错误
CPPHtmlStatic m_Tit2; //在增加这个对象时,就运行不起来了!
// CPPHtmlStatic m_Tit3;
// CHyperLink m_Tit2;
还有个问题我封装了一格WinXPButtonST类,后来不用了就给删了,可调试时说没找到它的虚构函数,我都把.h.cpp的文件删完了,怎么还会说虚构函数呢!?请高手指点了!?谢谢!
{
m_hDib = NULL;
m_dwLineWidth = 0;
m_wColors = 0; m_hMemDC = NULL;
m_hBitmap = NULL;
m_lpBits = NULL; FreeResources();
}时弹出对话框内容:Unhandled exception in setwin.exe:0xc0000006:Access Violation.