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