Trying to get the address of a test method and I'm getting NULL. I have
created a map file and everything looks correct:
<snip>
Exports
ordinal name
1 ?GetNumber@@YAHXZ (int __cdecl GetNumber(void))
</snip>
In the host DLL, I'm importing with this code:
<snip>
typedef int (CALLBACK* LPFNDLLFUNC1)(void);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hDLL =
LoadLibrary("Z:\\M3\\Code\\MAX_Plugins\\InFluFluIO\\Debug\\InFluFluIO.dll");
if (hDLL != NULL){
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
"GetNumber");
if (!lpfnDllFunc1){
// handle the error
::MessageBox(0, "Failed loading InFluFluIO dll", "some tools may not work
correctly", MB_OK|MB_ICONWARNING);
FreeLibrary(hDLL);
return -1;
}
else{
// call the function
result = lpfnDllFunc1();
FreeLibrary(hDLL);
}
}
</snip>
Even though the map file shows me the name, I have tried adding the "_"
before the name. I get NULL everytime. Anyone have any ideas?
Any help appreciated,
Steve Klett