kmmoens
August 3rd, 2004, 05:12 AM
Hi,
During porting of my VC++ 6 code to .NET i receive the LNK2001 linker error:
ChildView.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CDialog::messageMap" (?messageMap@CDialog@@1UAFX_MSGMAP@@B)
IvAcToolBar.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CDialog::messageMap" (?messageMap@CDialog@@1UAFX_MSGMAP@@B)
.\Debug/IvAc.exe : fatal error LNK1120: 1 unresolved externals
However - both classes, ChildView and IvAcToolBar, don't inherit from CDialog. ChildView from CWnd and IvacToolBar from CDialogBar.
Here is the code I use in ChildView.h
class CChildView : public CWnd {
public:
....
protected:
DECLARE_MESSAGE_MAP()
};
And in the cpp file:
BEGIN_MESSAGE_MAP(CChildView,CWnd)
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
ON_WM_RBUTTONUP()
....
END_MESSAGE_MAP()
In the IvAcToolbar.h:
class CIvAcToolBar: public CDialogBar {
public:
...
protected:
DECLARE_MESSAGE_MAP()
};
And in IvAcToolbar.cpp
BEGIN_MESSAGE_MAP(CIvAcToolBar, CDialogBar)
//{{AFX_MSG_MAP(CIvAcToolBar)
ON_WM_KILLFOCUS()
ON_COMMAND(IDC_CONNECT, OnConnect)
...
END_MESSAGE_MAP()
Any ideas?
Thx
During porting of my VC++ 6 code to .NET i receive the LNK2001 linker error:
ChildView.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CDialog::messageMap" (?messageMap@CDialog@@1UAFX_MSGMAP@@B)
IvAcToolBar.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CDialog::messageMap" (?messageMap@CDialog@@1UAFX_MSGMAP@@B)
.\Debug/IvAc.exe : fatal error LNK1120: 1 unresolved externals
However - both classes, ChildView and IvAcToolBar, don't inherit from CDialog. ChildView from CWnd and IvacToolBar from CDialogBar.
Here is the code I use in ChildView.h
class CChildView : public CWnd {
public:
....
protected:
DECLARE_MESSAGE_MAP()
};
And in the cpp file:
BEGIN_MESSAGE_MAP(CChildView,CWnd)
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
ON_WM_RBUTTONUP()
....
END_MESSAGE_MAP()
In the IvAcToolbar.h:
class CIvAcToolBar: public CDialogBar {
public:
...
protected:
DECLARE_MESSAGE_MAP()
};
And in IvAcToolbar.cpp
BEGIN_MESSAGE_MAP(CIvAcToolBar, CDialogBar)
//{{AFX_MSG_MAP(CIvAcToolBar)
ON_WM_KILLFOCUS()
ON_COMMAND(IDC_CONNECT, OnConnect)
...
END_MESSAGE_MAP()
Any ideas?
Thx