::GetModuleFileName(g_hInstDLL, szName, nSize);
::MessageBox(hwndParent, szName, _T(""), MB_OK);
where g_hInstDLL is the handle to the loaded module, usually available in the DLL entry point:
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
//assign the handle here
g_hInstDLL = (HINSTANCE)hModule;
break;
}
return TRUE;
}
http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/03b20581-1479-44aa-ba9d-caf1c313c4eb
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.