VC++ 2010 template typedef typename error

534 views Asked by At

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;
1

There are 1 answers

0
Alain Rist On

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:

// History (Date/Author/Description):
// ----------------------------------
//
// 2005/07/13: Daniel Bowen
// - Namespace qualify the use of more ATL and WTL classes.
// - CTabbedMDIFrameWindowImpl:
//   * Add GetMDITabCtrl