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. What is the diff between ?Foo@Class and ?FooA@Class in DLL export?

What is the diff between ?Foo@Class and ?FooA@Class in DLL export?

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomtoolshelp
6 Posts 4 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.
  • V Offline
    V Offline
    vmaltsev
    wrote on last edited by
    #1

    Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.

    J M M 3 Replies Last reply
    0
    • V vmaltsev

      Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.

      J Offline
      J Offline
      Joel Lucsy
      wrote on last edited by
      #2

      I'm not positive on this, but I believe the A specifies that the function is cdecl. I'd double-check the calling conventions. -- Joel Lucsy

      V 1 Reply Last reply
      0
      • J Joel Lucsy

        I'm not positive on this, but I believe the A specifies that the function is cdecl. I'd double-check the calling conventions. -- Joel Lucsy

        V Offline
        V Offline
        vmaltsev
        wrote on last edited by
        #3

        Thanks for an idea. I tried all three possible conventions, but result is still the same. So that's not it. va'Lery

        1 Reply Last reply
        0
        • V vmaltsev

          Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          I suspect that in the DLL, the function has the same name as a Windows function whose header you have included, while you haven't included the same header in the application. Example: the Windows header WinBase.h defines the functions DeleteFileA and DeleteFileW. It also maps the name DeleteFile via a macro to DeleteFileA or DeleteFileW depending on whether the UNICODE symbol is defined. This allows you to switch between using the ANSI and Unicode versions of the functions simply by defining or undefining UNICODE. Unfortunately the macro processor has no idea of scope and doesn't realise that you actually wanted to refer to a class member function rather than to refer to the Windows function, so it replaces your Foo with FooA. Solutions: either rename the function, or #undef the macro. If you #undef the macro, consider using #pragma push_macro and #pragma pop_macro to store and retrieve the macro value (supported in VC 6.0, even though undocumented). Using #undef in this way is a real hassle, though, so I'd simply rename the offending function.

          V 1 Reply Last reply
          0
          • M Mike Dimmick

            I suspect that in the DLL, the function has the same name as a Windows function whose header you have included, while you haven't included the same header in the application. Example: the Windows header WinBase.h defines the functions DeleteFileA and DeleteFileW. It also maps the name DeleteFile via a macro to DeleteFileA or DeleteFileW depending on whether the UNICODE symbol is defined. This allows you to switch between using the ANSI and Unicode versions of the functions simply by defining or undefining UNICODE. Unfortunately the macro processor has no idea of scope and doesn't realise that you actually wanted to refer to a class member function rather than to refer to the Windows function, so it replaces your Foo with FooA. Solutions: either rename the function, or #undef the macro. If you #undef the macro, consider using #pragma push_macro and #pragma pop_macro to store and retrieve the macro value (supported in VC 6.0, even though undocumented). Using #undef in this way is a real hassle, though, so I'd simply rename the offending function.

            V Offline
            V Offline
            vmaltsev
            wrote on last edited by
            #5

            That's it! You're absolutely right. :) Thanks a lot!

            1 Reply Last reply
            0
            • V vmaltsev

              Hi everyone, I have a DLL with some classes in it. Header file have dllexport feature on class. This class has some methods, several of them are virtual. So, the problem is that my test app looking for Foo method in DLL, but can't find it because in DLL it's defined as FooA, but not Foo. Can somebody tell me what's wrong? In this [post^] I describe situation in detailes with some code examples. Thanks in advance, va'Lery.

              M Offline
              M Offline
              Mukkie
              wrote on last edited by
              #6

              Hello! use UndName.Exe and pass full decorated function name to see it's full undecorated name. :)

              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