Tim*_*Tim 7 c++ linker mfc visual-studio-2008
我复制了一个dlg box类的现有头文件(使用dlg类向导/ mfc向导创建).在我将cpp文件添加到项目之前,一切似乎都没问题.现在我得到一些mfc魔术方法的奇怪链接错误:
错误LNK2001:未解析的外部符号"public:virtual struct CRuntimeClass*__thiscall DlgGapWindow :: GetRuntimeClass(void)const"(?GetRuntimeClass @ DlgGapWindow @@ UBEPAUCRuntimeClass @@ XZ)
错误LNK2001:未解析的外部符号"protected:virtual struct AFX_MSGMAP const*__thiscall DlgGapWindow :: GetMessageMap(void)const"(?GetMessageMap @ DlgGapWindow @@ MBEPBUAFX_MSGMAP @@ XZ)
为什么会这样?
这是标题中的相关代码
class DlgGapWindow : public CDialog
{
DECLARE_DYNAMIC(DlgGapWindow)
public:
DlgGapWindow(CWnd* pParent = NULL);
virtual ~DlgGapWindow();
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual BOOL OnInitDialog();
enum { IDD = IDD_DIALOG_GAP_VIEW };// Dialog Data
GapViewer m_chart;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSizing(UINT fwSide, LPRECT pRect) ;
afx_msg void OnTimer(ONTIMER_TYPE nIDEvent);
afx_msg void OnDestroy();
afx_msg void OnClose();
afx_msg void OnActivate(UINT,CWnd *,BOOL);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
Run Code Online (Sandbox Code Playgroud)
我似乎没有看到任何来自我的模型,因为它似乎缺失了.我没有发现谷歌或其他搜索有用的东西,以表明为什么这些神奇的mfc缺失.我的其他类没有明确定义它们,也没有错误.
RC文件确实有相应的dlg定义.
编辑:
感谢DECLARE_DYNAMIC帮助 - 现在我没有GetRuntimClass()错误 - 只是GetMessagemap()错误.
| 归档时间: |
|
| 查看次数: |
11501 次 |
| 最近记录: |