无法创建模态对话框

时间:2014-03-20 01:46:37

标签: visual-c++ mfc

简单地解决我的问题,

我按照此处的说明操作:http://msdn.microsoft.com/en-us/library/6wb9s9ah.aspx

但是当我尝试编译时,它给了我以下错误:

2>Link:
2>     Creating library C:\Users\Alvin\Documents\Visual Studio 2010\Projects\Emergence     
v1.3\Debug\EmergenceHandlers.lib and object C:\Users\Alvin\Documents\Visual Studio    
2010\Projects\Emergence v1.3\Debug\EmergenceHandlers.exp
2>EmergenceDoc.obj : error LNK2019: unresolved external symbol "public: virtual    
__thiscall CFindDlg::~CFindDlg(void)" (??1CFindDlg@@UAE@XZ) referenced in function    
"public: void __thiscall CEmergenceDoc::OnEditFind(void)" (?   
OnEditFind@CEmergenceDoc@@QAEXXZ)
2>EmergenceDoc.obj : error LNK2019: unresolved external symbol "public: __thiscall    
CFindDlg::CFindDlg(class CWnd *)" (??0CFindDlg@@QAE@PAVCWnd@@@Z) referenced in function    
"public: void __thiscall CEmergenceDoc::OnEditFind(void)" (?  
OnEditFind@CEmergenceDoc@@QAEXXZ)
2>C:\Users\Alvin\Documents\Visual Studio 2010\Projects\Emergence    
v1.3\Debug\EmergenceHandlers.dll : fatal error LNK1120: 2 unresolved externals

编辑:

我的代码如下:

FindDlg.cpp

#include "stdafx.h"
#include "Emergence.h"
#include "FindDlg.h"
#include "afxdialogex.h"
#include "resource.h"

IMPLEMENT_DYNAMIC(CFindDlg, CDialog)

CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFindDlg::IDD, pParent)
{

}

CFindDlg::~CFindDlg()
{
}

void CFindDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
END_MESSAGE_MAP()

FindDlg.h

#pragma once

class CFindDlg : public CDialog
{
DECLARE_DYNAMIC(CFindDlg)

public:
CFindDlg(CWnd* pParent = NULL);   // standard constructor
virtual ~CFindDlg();


enum { IDD = IDD_FIND };

protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

DECLARE_MESSAGE_MAP()
};

CEmergenceDoc中的代码:

void CEmergenceDoc::OnEditFind()
{
    CFindDlg test;
}

0 个答案:

没有答案