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. Error!!

Error!!

Scheduled Pinned Locked Moved C / C++ / MFC
help
9 Posts 3 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.
  • R Offline
    R Offline
    rowdy_vc
    wrote on last edited by
    #1

    Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface

    *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

    M M 2 Replies Last reply
    0
    • R rowdy_vc

      Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface

      *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

      M Offline
      M Offline
      Michael Schubert
      wrote on last edited by
      #2

      Suggest what?

      R 1 Reply Last reply
      0
      • M Michael Schubert

        Suggest what?

        R Offline
        R Offline
        rowdy_vc
        wrote on last edited by
        #3

        How to solve that error?

        *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

        M 1 Reply Last reply
        0
        • R rowdy_vc

          Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface

          *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

          M Offline
          M Offline
          manish patel
          wrote on last edited by
          #4

          You are creating object of the Interface IFileIO

          rowdy_vc++ wrote:

          EDCService::IFileIO fio;

          Do this: EDCService fio; Is this you want??

          Manish Patel. B.E. - Information Technology.

          R 1 Reply Last reply
          0
          • R rowdy_vc

            How to solve that error?

            *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

            M Offline
            M Offline
            Michael Schubert
            wrote on last edited by
            #5

            It took me 10 seconds to find this: http://msdn2.microsoft.com/en-us/library/7d4ezh73(VS.80).aspx[^] Why don't you try to figure things out for yourself before spamming this board?

            R 1 Reply Last reply
            0
            • M manish patel

              You are creating object of the Interface IFileIO

              rowdy_vc++ wrote:

              EDCService::IFileIO fio;

              Do this: EDCService fio; Is this you want??

              Manish Patel. B.E. - Information Technology.

              R Offline
              R Offline
              rowdy_vc
              wrote on last edited by
              #6

              yes i try ...but showing this error error C2259: 'EDCService' : cannot instantiate abstract class

              *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

              M 2 Replies Last reply
              0
              • M Michael Schubert

                It took me 10 seconds to find this: http://msdn2.microsoft.com/en-us/library/7d4ezh73(VS.80).aspx[^] Why don't you try to figure things out for yourself before spamming this board?

                R Offline
                R Offline
                rowdy_vc
                wrote on last edited by
                #7

                hi michel thanks 2 your replay...Already i try this logic ..wen i add that dll..via (#using "mscorlib.dll").. showing this error: fatal error C1190: managed targeted code requires a '/clr' option

                *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

                1 Reply Last reply
                0
                • R rowdy_vc

                  yes i try ...but showing this error error C2259: 'EDCService' : cannot instantiate abstract class

                  *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

                  M Offline
                  M Offline
                  manish patel
                  wrote on last edited by
                  #8

                  Do you realy need for IFileIO interface? If you don't need it then remove it. What declarations you made inside it?

                  Manish Patel. B.E. - Information Technology.

                  1 Reply Last reply
                  0
                  • R rowdy_vc

                    yes i try ...but showing this error error C2259: 'EDCService' : cannot instantiate abstract class

                    *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

                    M Offline
                    M Offline
                    manish patel
                    wrote on last edited by
                    #9

                    I tried this:: IFileIO.h #pragma once interface IFileIO { void setData(int xi); }; EDCService.h #pragma once #include "IFileIO.h" class EDCService:public IFileIO { public: EDCService(){}; int x; void setData(int xi) { x = xi; } }; Its works fine for me. I can create instance like this EDCService serviceObj; Try it and let me know how it works

                    Manish Patel. B.E. - Information Technology.

                    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