MFC扩展DLL中的类继承问题,急求解决方案!急急急!
在VC6.0中利用向导创建一个MFC AppWizard[dll]的MFC Extension Dll工程Test2,在工程Test2中添加继承CSpecialOperation(工程Test中)的类TestCtrl2,类的内容如下:
头文件:
#if !defined(AFX_TESTCTRL2_H__389D6F80_D547_49B9_99EF_E5F8C0AD2B61__INCLUDED_)
#define AFX_TESTCTRL2_H__389D6F80_D547_49B9_99EF_E5F8C0AD2B61__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TestCtrl2.h : header file
//
#include "SpecialOperation.h"
/////////////////////////////////////////////////////////////////////////////
// CTestCtrl2 window
class CTestCtrl2 : public CSpecialOperation /*CSpecialOperation是属于工程Test的类*/
{
public:
CTestCtrl2();
public:
virtual ~CTestCtrl2();
protected:
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TESTCTRL2_H__389D6F80_D547_49B9_99EF_E5F8C0AD2B61__INCLUDED_)
源文件:
#include "stdafx.h"
#include "TestCtrl2.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTestCtrl2
CTestCtrl2::CTestCtrl2()
{
}
CTestCtrl2::~CTestCtrl2()
{
}
BEGIN_MESSAGE_MAP(CTestCtrl2, CSpecialOperation)
//{{AFX_MSG_MAP(CTestCtrl2)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
当Build工程Test2时出现链接错误,错误信息如下:
--------------------Configuration: Test2 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Test2.cpp
TestCtrl2.cpp
Generating Code...
Linking...
Creating library Debug/Test2.lib and object Debug/Test2.exp
TestCtrl2.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const
CSpecialOperation::messageMap" (?messageMap@CSpecialOperation@@1UAFX_MSGMAP@@B)
Debug/Test2.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Test2.dll - 2 error(s), 0 warning(s)
请问如何解决这个链接错误?