1
votes

LPTSTR DLLPath = new TCHAR[_MAX_PATH]; ::GetModuleFileName((HINSTANCE)&__ImageBase, DLLPath, _MAX_PATH);

I was using the above function to get the isapi dll physical path. it works fine in debug mode.When i try to build it in release mode it says __ImageBase unidentified . can anyone suggest me an alternative to this.

thanks

2

2 Answers

0
votes

You should probably cast it like so:

__ImageBase is normally the value: 0x400000, this is normally where the Image Loader, loads the .exe in memory.

HINSTANCE hInst = reinterpret_cast<HINSTANCE>(&__ImageBase)
0
votes

You should probably save and use the hInstance parameter passed into DllMain() rather than __ImageBase.