Unable to launch modal dialog box

I've created a simple MFC text editor, and I want to launch a dialog box when the user goes to the menu Edit->Find. I have been following the instructions here http://msdn.microsoft.com/en-us/library/6wb9s9ah.aspx

So far I have: created a dialog box visually in the resource editor, created the 'Find' menu item, created a class for the dialog, and linked the dialog to the menu item. However, when I compile, it gives me the following error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  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


Any help would be greatly appreciated.

Edit:

My code is as follows:

FindDlg.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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()



Code inside CEmergenceDoc
1
2
3
4
void CEmergenceDoc::OnEditFind()
{
    CFindDlg test;
}
Last edited on
Any help?
Topic archived. No new replies allowed.