meshviewer\exWTL\DotNetTabCtrl.h(1515) : error C3203: “CDotNetTabCtrl”: 未专用化的类 模板 不能用作 模板 变量,该变量属于 模板 参数“T”,应为 real 类型
其代码如下:
template <class TItem = CCustomTabItem>
class CDotNetTabCtrl :
public CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem>
{
protected:
typedef CDotNetTabCtrl thisClass;
typedef CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem> baseClass;
// Constructors:
public:
CDotNetTabCtrl()
{
}
public:
DECLARE_WND_CLASS(_T("WTL_DotNetTabCtrl"))
//We have nothing special to add.
//BEGIN_MSG_MAP(thisClass)
// CHAIN_MSG_MAP(baseClass)
//END_MSG_MAP()
};
class CDotNetTabCtrl :
public CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem>
{
protected:
typedef CDotNetTabCtrl thisClass;
typedef CDotNetTabCtrlImpl<CDotNetTabCtrl, TItem> baseClass;
// Constructors:
public:
CDotNetTabCtrl()
{
}
public:
DECLARE_WND_CLASS(_T("WTL_DotNetTabCtrl"))
//We have nothing special to add.
//BEGIN_MSG_MAP(thisClass)
// CHAIN_MSG_MAP(baseClass)
//END_MSG_MAP()
};
根据MSDN所述:
// C3203.cpp
template< typename T >
struct X {
void f(X) {}
};
template< typename T >
struct Y : public X<Y> { // C3203
// try the following line instead
// struct Y : public X<Y<T> > {
void f(Y) {}
};
int main() {
Y<int> y;
}
template< typename T >
struct X {
void f(X) {}
};
template< typename T >
struct Y : public X<Y> { // C3203
// try the following line instead
// struct Y : public X<Y<T> > {
void f(Y) {}
};
int main() {
Y<int> y;
}
将第三行代码替换成:
public CDotNetTabCtrlImpl<CDotNetTabCtrl<TItem>, TItem>
即可。