用模板类CTypedPtrList出错了请看看。
CTypedPtrList<CPtrList,CCruiseStruct*> m_crList;
if(m_pcuriset->GetRecordCount()!=0)
{
m_pcuriset->Requery();
m_pcuriset->MoveFirst();
while(!m_pcuriset->IsEOF())
{
CCruiseStruct* newstruct=new CCruiseStruct(m_pcuriset);
m_crList.AddTail(newstruct);
m_pcuriset->MoveNext();
}
}
CCruiseStruct的祖先类为CPtrList。
D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\INCLUDE\afxtempl.h(1616) : error C2440: 'return' : cannot convert from 'void' to 'struct __POSITION *'
Expressions of type void cannot be converted to other types
D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\INCLUDE\afxtempl.h(1616) : while compiling class-template member function 'struct __POSITION *__thiscall CTypedPtrList<class CPtrList,class CCruiseStruct *>::AddTail(class CCruiseStruct *)'