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. Happy Children's day to All! I met a problem. I can't use the derived Class from CSocket in Another Class.

Happy Children's day to All! I met a problem. I can't use the derived Class from CSocket in Another Class.

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingworkspace
6 Posts 3 Posters 1 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.
  • O Offline
    O Offline
    ocean2000
    wrote on last edited by
    #1

    I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!

    PJ ArendsP H 2 Replies Last reply
    0
    • O ocean2000

      I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      You are missing a semicolon. It could be in MySocket.cpp before line 22, or it could be in one of the header files that you included in MySocket.cpp


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      1 Reply Last reply
      0
      • O ocean2000

        I derived a new class named CMySocket from CSocket. Then generate another class named CCollectorInfo (in order to store the information of Collector),I defined a CMySocket pointer in this class. Already included the header file of CMySocket I got error messages as follow: --------------------Configuration: SaroTransfer - Win32 Debug-------------------- Compiling... MySocket.cpp c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2143: syntax error : missing ';' before '*' c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'CMySocket' : missing storage-class or type specifiers c:\documents and settings\administrator\×ÀÃæ\sarotransfer\collectorinfo.h(22) : error C2501: 'pSocket' : missing storage-class or type specifiers Error executing cl.exe. SaroTransfer.exe - 3 error(s), 0 warning(s) Thanks of any help!

        H Offline
        H Offline
        HENDRIK R
        wrote on last edited by
        #3

        Sounds like the compiler doesn't recognize CMySocket. If you included MySocket.h inside collectorinfo.h, then announce the class in collectorinfo.h by typing class CMySocket before any declarations. Or inlcude the header inside collectorinfo.h.


        We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

        O 1 Reply Last reply
        0
        • H HENDRIK R

          Sounds like the compiler doesn't recognize CMySocket. If you included MySocket.h inside collectorinfo.h, then announce the class in collectorinfo.h by typing class CMySocket before any declarations. Or inlcude the header inside collectorinfo.h.


          We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

          O Offline
          O Offline
          ocean2000
          wrote on last edited by
          #4

          Erverthing is ok today! I don't know why

          O H 2 Replies Last reply
          0
          • O ocean2000

            Erverthing is ok today! I don't know why

            O Offline
            O Offline
            ocean2000
            wrote on last edited by
            #5

            Anyway,thanks a lot for your replies.

            1 Reply Last reply
            0
            • O ocean2000

              Erverthing is ok today! I don't know why

              H Offline
              H Offline
              HENDRIK R
              wrote on last edited by
              #6

              ocean2000 wrote: Erverthing is ok today! I don't know why ... better than the other way around ;)


              We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

              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