это сообщение об ошибке компилятора Visual Studio 2010 (хотя у него нет проблем с компилятором micrsoft visual studio 2003)
error C2259: 'user_param::UserParamB2<std::string>' : cannot instantiate abstract class due to following members:
'bool user_param::UserParamBase::readonly(bool)' : is abstract
c:\qc\qc_daq\src\hfgui3\userparambase.h(128) : see declaration of 'user_param::UserParamBase::readonly'
'bool user_param::UserParamBase::readonly(void)' : is abstract
c:\qc\qc_daq\src\hfgui3\userparambase.h(127) : see declaration of 'user_param::UserParamBase::readonly'
'SIZE user_param::UserParamBase::winSize(void)' : is abstract
c:\qc\qc_daq\src\hfgui3\userparambase.h(129) : see declaration of 'user_param::UserParamBase::winSize'
Мой исходный код выглядит следующим образом:
class UserParamBase : public UserParamName
{
public:
virtual bool readonly() =0;
virtual bool readonly(bool bReadonly)=0;
virtual SIZE winSize()=0;
virtual bool get()=0;
virtual void create(CWnd* pParentWnd,const RECT& rect)=0;
virtual void close()=0;
virtual void update()=0;
}
...
template <>
class UserParam< string > : public UserParamB2< string >
{
public:
bool get()
{
AutoCritSec acsWnd(m_csWnd, true);
if(m_wnd.combobox && m_wnd.combobox->GetSafeHwnd()) {
CString text;
m_wnd.combobox->GetWindowText(text);
this->assign((LPCSTR) text);
} else if(m_wnd.wnd && m_wnd.wnd->GetSafeHwnd()) {
char* psz=NULL;
string s;
unsigned uSize = m_wnd.wnd->GetWindowTextLength()+1;
try {
psz=new char[uSize];
m_wnd.wnd->GetWindowText(psz,uSize);
s.assign(psz);
}
catch(...) {
if(psz) delete [] psz;
throw;
}
if(psz) delete [] psz;
s.erase(std::remove(s.begin(),s.end(),'\r'),s.end());
this->assign(s);
}
return true;
}
Сообщение об ошибке появляется в операторе this->assign(s);
.