Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. i have written my own collection class,some errors

i have written my own collection class,some errors

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bhogavalli suresh
    wrote on last edited by
    #1

    .h file........................ #if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) #define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CStream:public CObject { public: CStream(); CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo); virtual ~CStream(); CString m_strName; CString m_strAge; CString m_strDep; CString m_strNo; }; class CStreams:public CList { public: CStream * Find(CString& sIDStream); CStreams(); virtual ~CStreams(); void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo); }; #endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) THIS R THE ERRORS I GOT PLEASE HELP ME i have given the implementation in .cpp file also........... this r the errors............. Compiling... CStream.cpp e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<' e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<' E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier Error executing cl.exe. Cllectdlg.exe - 4 error(s), 0 warning(s)

    C H N D 4 Replies Last reply
    0
    • B bhogavalli suresh

      .h file........................ #if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) #define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CStream:public CObject { public: CStream(); CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo); virtual ~CStream(); CString m_strName; CString m_strAge; CString m_strDep; CString m_strNo; }; class CStreams:public CList { public: CStream * Find(CString& sIDStream); CStreams(); virtual ~CStreams(); void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo); }; #endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) THIS R THE ERRORS I GOT PLEASE HELP ME i have given the implementation in .cpp file also........... this r the errors............. Compiling... CStream.cpp e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<' e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<' E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier Error executing cl.exe. Cllectdlg.exe - 4 error(s), 0 warning(s)

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Did you include the header file of CList ?


      Cédric Moonen Software developer
      Charting control [v1.2]

      1 Reply Last reply
      0
      • B bhogavalli suresh

        .h file........................ #if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) #define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CStream:public CObject { public: CStream(); CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo); virtual ~CStream(); CString m_strName; CString m_strAge; CString m_strDep; CString m_strNo; }; class CStreams:public CList { public: CStream * Find(CString& sIDStream); CStreams(); virtual ~CStreams(); void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo); }; #endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) THIS R THE ERRORS I GOT PLEASE HELP ME i have given the implementation in .cpp file also........... this r the errors............. Compiling... CStream.cpp e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<' e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<' E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier Error executing cl.exe. Cllectdlg.exe - 4 error(s), 0 warning(s)

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Did you include afxtempl.h?

        1 Reply Last reply
        0
        • B bhogavalli suresh

          .h file........................ #if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) #define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CStream:public CObject { public: CStream(); CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo); virtual ~CStream(); CString m_strName; CString m_strAge; CString m_strDep; CString m_strNo; }; class CStreams:public CList { public: CStream * Find(CString& sIDStream); CStreams(); virtual ~CStreams(); void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo); }; #endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) THIS R THE ERRORS I GOT PLEASE HELP ME i have given the implementation in .cpp file also........... this r the errors............. Compiling... CStream.cpp e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<' e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<' E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier Error executing cl.exe. Cllectdlg.exe - 4 error(s), 0 warning(s)

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          as the others said, the header file for CList is not included if you want to have an example of working with templates of collections take a look to the Smart Lists in: Simon Huge's article[^] My Article[^]

          Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

          1 Reply Last reply
          0
          • B bhogavalli suresh

            .h file........................ #if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) #define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CStream:public CObject { public: CStream(); CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo); virtual ~CStream(); CString m_strName; CString m_strAge; CString m_strDep; CString m_strNo; }; class CStreams:public CList { public: CStream * Find(CString& sIDStream); CStreams(); virtual ~CStreams(); void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo); }; #endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_) THIS R THE ERRORS I GOT PLEASE HELP ME i have given the implementation in .cpp file also........... this r the errors............. Compiling... CStream.cpp e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<' e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<' E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier Error executing cl.exe. Cllectdlg.exe - 4 error(s), 0 warning(s)

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            bhogavalli suresh wrote:

            e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined

            Notice the header requirements here.


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups