请看看DLL问题
我是通过WIN32向导建立一个静态的DLL文件
<<<<<<<<MYDLL.H>>>>>>>
#pragma once
#include "CmFrameWnd.h"
class AFX_EXT_CLASS CmFrameWnd:public CFrameWnd
{
public:
......................
__declspec(dllexport) afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
<<<<<<<<MYDLL.CPP>>>>>>>>
.....................
BEGIN_MESSAGE_MAP(CmFrameWnd, CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
void CmFrameWnd::OnPaint()
{
CPaintDC dc(this);
}
编译DLL没有报错
**************调用***************
<<<<<<<<<<H>>>>>>>>>>>>>
#include "mydll.h"
#pragma comment(lib,"dll.lib")
.....................
CmFrameWnd fw;
报错如下
InfoEngine.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CmFrameWnd::GetMessageMap(void)const " (?GetMessageMap@CmFrameWnd@@MBEPBUAFX_MSGMAP@@XZ)
E:\备份程序库\Studio\InfoEngine\Debug\InfoEngine.exe : fatal error LNK1120: 1 unresolved externals
但是我去
去掉DECLARE_MESSAGE_MAP()却编译成功,为什么????
如何解决这个问题,谢谢:)
[此贴子已经被作者于2006-4-20 12:16:03编辑过]