CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Fort Worth Texas
    Posts
    614

    CMap compile error

    The following is a section of the header file where I am trying to use CMap

    // SandsEventRecordView.h : interface of the CSandsEventRecordView class
    //
    /////////////////////////////////////////////////////////////////////////////

    #if !defined(AFX_SANDSEVENTRECORDVIEW_H__51089A0F_1A83_11D3_AEA8_006097C3C9B9__INCLUDED_)
    #define AFX_SANDSEVENTRECORDVIEW_H__51089A0F_1A83_11D3_AEA8_006097C3C9B9__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    typedef CMap<long,long,CEventRecord*,CEventRecord*&> CMapEventRecord;

    class CSandsEventRecordView : public CView
    {
    protected: // create from serialization only
    CSandsEventRecordView();
    DECLARE_DYNCREATE(CSandsEventRecordView)

    // Attributes
    public:
    CSandsEventRecordDoc* GetDocument();

    // Operations
    public:

    CMapEventRecord m_e;
    I get the following error:

    Compiling...
    SandsEventRecord.cpp
    d:\experiment\sandseventrecord\sandseventrecordview.h(12) : error C2143: syntax error : missing ';' before '<'
    d:\experiment\sandseventrecord\sandseventrecordview.h(12) : error C2143: syntax error : missing ';' before '<'


    Thanks

    Jim Bassett


  2. #2
    Join Date
    May 1999
    Posts
    128

    Re: CMap compile error

    Have you included afxtempl.h? you'll need this for the template collection classes. just bung it in StdAfx.h.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured