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 C2664????

error C2664????

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 Posts 4 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.
  • A Offline
    A Offline
    ashokbngr
    wrote on last edited by
    #1

    Hi All, I am getting the follwing error when I try to compilethe code...Please help error C2664: '__thiscall CUSBMgr::CUSBMgr(const class CUSBMgr&)' : cannot convert parameter 1 from 'class CString' to 'const class CUSBMgr&' Reason: cannot convert from 'class CString' to 'const class CUSBMgr' No constructor could take the source type, or constructor overload resolution was ambiguous:confused: Thanks in Advance Ashok

    S P 2 Replies Last reply
    0
    • A ashokbngr

      Hi All, I am getting the follwing error when I try to compilethe code...Please help error C2664: '__thiscall CUSBMgr::CUSBMgr(const class CUSBMgr&)' : cannot convert parameter 1 from 'class CString' to 'const class CUSBMgr&' Reason: cannot convert from 'class CString' to 'const class CUSBMgr' No constructor could take the source type, or constructor overload resolution was ambiguous:confused: Thanks in Advance Ashok

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      Looks like the class CUSBMgr has no constructor that accepts a CString. Can you show the code in question?

      Steve

      1 Reply Last reply
      0
      • A ashokbngr

        Hi All, I am getting the follwing error when I try to compilethe code...Please help error C2664: '__thiscall CUSBMgr::CUSBMgr(const class CUSBMgr&)' : cannot convert parameter 1 from 'class CString' to 'const class CUSBMgr&' Reason: cannot convert from 'class CString' to 'const class CUSBMgr' No constructor could take the source type, or constructor overload resolution was ambiguous:confused: Thanks in Advance Ashok

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Modify the constructor which takes CString as an argument. I guess you are trying to provide the copy constructor for your class. Could you please share the code which gives this error ? Regards, Paresh.

        A 1 Reply Last reply
        0
        • P Paresh Chitte

          Modify the constructor which takes CString as an argument. I guess you are trying to provide the copy constructor for your class. Could you please share the code which gives this error ? Regards, Paresh.

          A Offline
          A Offline
          ashokbngr
          wrote on last edited by
          #4

          I wrote the code like this CUSBMgr *ptrUSBManger= NULL; CString strControlPortName = _T(""); ptrUSBManger = new CUSBMgr(strControlPortName);///error 2664???? this is the constructor CUSBMgr::CUSBMgr(const CString& strControlPortName) { } Thanks In Advance Ashok

          T 1 Reply Last reply
          0
          • A ashokbngr

            I wrote the code like this CUSBMgr *ptrUSBManger= NULL; CString strControlPortName = _T(""); ptrUSBManger = new CUSBMgr(strControlPortName);///error 2664???? this is the constructor CUSBMgr::CUSBMgr(const CString& strControlPortName) { } Thanks In Advance Ashok

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            can you show the code which is constructing your object, because the compiler talks about CUSBMgr::CUSBMgr(const class CUSBMgr&)


            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            P 1 Reply Last reply
            0
            • T toxcct

              can you show the code which is constructing your object, because the compiler talks about CUSBMgr::CUSBMgr(const class CUSBMgr&)


              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              P Offline
              P Offline
              Paresh Chitte
              wrote on last edited by
              #6

              Which compiler are you using ? Regards, Paresh.

              T 1 Reply Last reply
              0
              • P Paresh Chitte

                Which compiler are you using ? Regards, Paresh.

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                me ? or the OP ?


                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                P 1 Reply Last reply
                0
                • T toxcct

                  me ? or the OP ?


                  [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                  P Offline
                  P Offline
                  Paresh Chitte
                  wrote on last edited by
                  #8

                  OP means ? is it Original Poster ? Regards, Paresh.

                  T 1 Reply Last reply
                  0
                  • P Paresh Chitte

                    OP means ? is it Original Poster ? Regards, Paresh.

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #9

                    for what i understand, yes...


                    [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                    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