c++ dll question

  • Thread starter Thread starter Scott McFadden
  • Start date Start date
S

Scott McFadden

Is there a Win32 call for retrieving the path for which the current / active
DLL was loaded (I don't care to use GetModuleName as it only gives me the
path to the host process EXE).

thanks


ScottM
 
Scott McFadden said:
Is there a Win32 call for retrieving the path for which the current /
active DLL was loaded (I don't care to use GetModuleName as it only gives
me the path to the host process EXE).

GetModuleName() will do the job id you pass it the instance handle to the
DLL which is available to you in DLL main.

If you don't have the handle, something like this will do the trick

blah foo(blah blah blah)
{
HINSTANCE hInst;
MEMORY_BASIC_INFORMATION mbi = { 0 };

VirtualQuery(&foo, &mbi, sizeof(mbi));
hInst = (HINSTANCE) mbi.AllocationBase;
}

Regards,
Will
www.ivrforbeginners.com
 
Back
Top