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. dll eat my functions :<

dll eat my functions :<

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
2 Posts 2 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.
  • N Offline
    N Offline
    novachen
    wrote on last edited by
    #1

    Hi! I think it maybe a question difficult to answer. But I hope there are some people share the same experience with me will give me some hint. I find one dll project very weird. There are some functions in the dll to be export. They are declare with _declspec(dllexport). But some function(about 5%) can't be find in the generated dll. (I used ultraedit to search for the name in the dll binary) I finally find out it have some relation to its parameter. for example int funcNoUse(long lRegionID) { return 0; } will be ok, it's generated in the dll. But if i change it to int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR szFlags, int makeCopy) { return 0; } it will not exist in the dll. I really don't know what's up. I have test it on two computer one with VS7 and another with VS7.1 have the same result. any idea?

    R 1 Reply Last reply
    0
    • N novachen

      Hi! I think it maybe a question difficult to answer. But I hope there are some people share the same experience with me will give me some hint. I find one dll project very weird. There are some functions in the dll to be export. They are declare with _declspec(dllexport). But some function(about 5%) can't be find in the generated dll. (I used ultraedit to search for the name in the dll binary) I finally find out it have some relation to its parameter. for example int funcNoUse(long lRegionID) { return 0; } will be ok, it's generated in the dll. But if i change it to int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR szFlags, int makeCopy) { return 0; } it will not exist in the dll. I really don't know what's up. I have test it on two computer one with VS7 and another with VS7.1 have the same result. any idea?

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      Sounds like you be being a victim of "Name mangling". This is something the C++ compiler does so that overloaded functions with the same name but different parameters can be properly resolved by the linker. You can force the compiler to turn of "Name mangling" for a specific function by using extern "C" in the function declaration.

      extern "C" int funcNoUse(long lRegionID, long nPoints, float* pY, LPCTSTR szFlags, int makeCopy)

      Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

      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