VC++ 2010 模板 typedef 类型名错误
我正在尝试将项目迁移到 VC++ 2010 该项目包含文件 TabbedMDI.h(由 Danial Bowen 编写),该文件给出错误“named后跟 '::' 必须是该行的类或命名空间名称 “typedef 类型名 TClient::TTabCtrl TTabCtrl;”
代码片段如下
template <
class T,
class TClient = CTabbedMDIClient< CDotNetTabCtrl<CTabViewTabItem> >,
class TBase = WTL::CMDIWindow,
class TWinTraits = ATL::CFrameWinTraits>
class ATL_NO_VTABLE CTabbedMDIFrameWindowImpl :
public WTL::CMDIFrameWindowImpl<T, TBase, TWinTraits >
{
public:
// Expose the type of MDI client
typedef typename TClient TClient;
// Expose the type of tab control
typedef typename TClient::TTabCtrl TTabCtrl;
// Member variables
protected:
TClient m_tabbedClient;
I am trying to migrate a project to VC++ 2010
The project contains the file TabbedMDI.h (by Danial Bowen) which gives the error "named followd by '::' must be a class or namespace name for the line
"typedef typename TClient::TTabCtrl TTabCtrl;"
code snipit follows
template <
class T,
class TClient = CTabbedMDIClient< CDotNetTabCtrl<CTabViewTabItem> >,
class TBase = WTL::CMDIWindow,
class TWinTraits = ATL::CFrameWinTraits>
class ATL_NO_VTABLE CTabbedMDIFrameWindowImpl :
public WTL::CMDIFrameWindowImpl<T, TBase, TWinTraits >
{
public:
// Expose the type of MDI client
typedef typename TClient TClient;
// Expose the type of tab control
typedef typename TClient::TTabCtrl TTabCtrl;
// Member variables
protected:
TClient m_tabbedClient;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚编译了 Daniel 的 SimpleTabbedMDIDemo 示例,来自 自定义选项卡控件、选项卡式框架和选项卡式MDI 与 VC2010 Express(WTL 8.1、来自 WinDDK 的 ATL 8.00)没有问题(除了清单重复)。
你的问题在别处。
[编辑]
您使用最新的 TabbedMDI.h 吗?我的有:
Just compiled Daniel's SimpleTabbedMDIDemo sample from Custom Tab Controls, Tabbed Frame and Tabbed MDI with VC2010 Express (WTL 8.1, ATL 8.00 from WinDDK) without problem (except manifest duplication).
Your problem is elsewhere.
[Edit]
Do you use the latest TabbedMDI.h? mine has: