为何会出现这错误,该如何该
vcdll 2002-02-12 11:45:43 d:\microsoft visual studio\vc98\mfc\include\afxtempl.h(73) : error C2248: 'id1::~id1' : cannot access protected member declared in class 'id1'
f:\vcpp32\netchat\id11.h(46) : see declaration of 'id1::~id1'
d:\microsoft visual studio\vc98\mfc\include\afxtempl.h(299) : see reference to function template instantiation 'void __stdcall DestructElements(class id1 *,int)' being compiled
Error executing cl.exe.
#include "stdafx.h"
#include "netchat.h"
#include "id11.h"
#include "afxtempl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// id11
IMPLEMENT_DYNCREATE(id1, CCmdTarget)
id1::id1()
{
name="";
ID=0;
icon=0;
}
id1& id1::operator=(id1& src)
{
if(this != &src)
{
name = src.name;
ID=src.ID;
icon=src.icon;
// repeat for every member variable in the class
}
return *this;
}
/////////////////////////////////////////////////////////////////////////////
// id1 message handlers
BEGIN_MESSAGE_MAP(id1, CCmdTarget)
//{{AFX_MSG_MAP(id11)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CArray<id1,id1&>m_id1;
/////////////////////////////////////////////////////////////////////////////
// id11 message handlers