为了更能说清楚我现在遇到的问题,我重新开贴,见谅啊。
我写了一个扩展mfc  dll 中,定义了一个扩展类CRadarStateDialog,它派生于CXXDialog,CXXDialog派生于CMyDialog,CMyDialog派生于CDialog。 即:
CRadarStateDialog-----------CXXDialog----------CMyDialog---------CDialog。。然后我在主程序中调用这个dll, 调用代码为:#include"dll.h"
#pragma comment(lib,"Test.lib")class _declspec(dllimport) CRadarStateDialog;void CTestMyDllView::OnDianji() 
{
pdlg=new CRadarStateDialog(this);pdlg->ShowWindow(SW_SHOW);
}

以下是我的 扩展dll的代码:dll.h文件#include"Resource.h"
class CMyDialog:public CDialog
{
public: CMyDialog(UINT ID,CWnd* pParnet):CDialog(ID,pParnet)
{
}
~CMyDialog(){}
// DECLARE_MESSAGE_MAP()};class CXXDialog:public CMyDialog
{
public:
CXXDialog(UINT ID,CWnd* pParent):CMyDialog(ID,pParent)
{
}
~CXXDialog(){}// DECLARE_MESSAGE_MAP()
};
//导出类
class _declspec(dllexport) CRadarStateDialog:public CXXDialog
{
public:
CRadarStateDialog(CWnd* pParent):CXXDialog(IDD,pParent)
{
m_pParent=pParent;
}
~CRadarStateDialog(){} enum{IDD=IDD_DIALOG1};private: CWnd* m_pParent;
//封装了一下
public:
void Produce()
{
Create(IDD,m_pParent);
}
// DECLARE_MESSAGE_MAP()
};////////////////////////////////////////////////////////////////////////////////////////////dll.cpp文件
#include"StdAfx.h"#include"dll.h"/*
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)END_MESSAGE_MAP()BEGIN_MESSAGE_MAP(CXXDialog, CMyDialog)END_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CRadarStateDialog, CXXDialog)END_MESSAGE_MAP()  */报错信息为:--------------------Configuration: TestMyDll - Win32 Debug--------------------
Linking...
   Creating library Debug/TestMyDll.lib and object Debug/TestMyDll.exp
TestMyDllView.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CRadarStateDialog::GetMessageMap(void)const " (?GetMessageMap@CRadarStateDialog@@MBEPBUAFX_MSGMAP@@XZ)
TestMyDllView.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CXXDialog::GetMessageMap(void)const " (?GetMessageMap@CXXDialog@@MBEPBUAFX_MSGMAP@@XZ)
TestMyDllView.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CMyDialog::GetMessageMap(void)const " (?GetMessageMap@CMyDialog@@MBEPBUAFX_MSGMAP@@XZ)
Debug/TestMyDll.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.TestMyDll.exe - 4 error(s), 0 warning(s)
当我取消 消息映射的注释后,依然报错,报错的信息与 ::GetMessageMap 有关系!!!!!!!!!!我查过msdn的说法,说是mfc类都有一个静态对象对应着,  当导出mfc类的时候,要特别小心高手解答一下,我到底该如何做??代码不复杂, 有编译器的兄台可以做个测试一下,  看是不是和我说的一样!!!!!1111代码直接复制就可以了