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. enum Datatype: Overloaded function differ only by return type error...?

enum Datatype: Overloaded function differ only by return type error...?

Scheduled Pinned Locked Moved C / C++ / MFC
3 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.
  • M Offline
    M Offline
    mbatra31
    wrote on last edited by
    #1

    Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:

    \#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
    rename( "EOF", "adoEOF" )
    \#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
    no_namespace

    I am getting the following error:

    error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'

    Any idea why this error is generated...? How to resolve the above issue...? Regards, mba

    L L 2 Replies Last reply
    0
    • M mbatra31

      Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:

      \#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
      rename( "EOF", "adoEOF" )
      \#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
      no_namespace

      I am getting the following error:

      error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'

      Any idea why this error is generated...? How to resolve the above issue...? Regards, mba

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The definition of that enum exists in two places. You need to check the libraries to see how you can eleiminate one of them. I would guess it may have something to do with the second import using the no_namespace option.

      1 Reply Last reply
      0
      • M mbatra31

        Hi, I am working on a project in Visual C++ 6.0. I have included the following statements in a file:

        \#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
        rename( "EOF", "adoEOF" )
        \#import "c:\Program Files\Common Files\system\ado\msadox.dll" \
        no_namespace

        I am getting the following error:

        error C2556: 'enum DataTypeEnum __thiscall ADODB::Field20::GetType(void)' : overloaded function differs only by return type from 'enum ADODB::DataTypeEnum __thiscall ADODB::Field20::GetType(void)'

        Any idea why this error is generated...? How to resolve the above issue...? Regards, mba

        L Offline
        L Offline
        leon de boer
        wrote on last edited by
        #3

        Richard was spot on ADO and ADOX both use the no_namespace option you need to rename the functions of one into a renamed namespace

        #import "..\..\..\dll\msadox.dll" // Importing Adox unchanged in this example
        #import "..\..\..\dll\msado15.dll" no_namespace rename("EOF", "EOFADO")rename("DataTypeEnum", "DataTypeEnumADO") rename("EditModeEnum", "EditModeEnumADO") \
        rename("FieldAttributeEnum", "FieldAttributeEnumADO") rename("LockTypeEnum", "LockTypeEnumADO") // Rename each function you want to use into current namespace with ADO at end

        // The ADO at the end just makes remembering the name easy

        You could choose to import the ADO and rename the ADOX functions, rename the one you use least.

        In vino veritas

        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