Terry
2010-05-20 09:05:01 UTC
Hi,all:
My namespace extension using following flag to enable XP style common control.
ISOLATION_AWARE_ENABLED
It works.
But when the last function _Term() which is called when explorer close.
It is called in DllMain like this:
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID
/*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if(S_OK != _Module.Init(ObjectMap, hInstance))
return FALSE;
g_hInstAppRes = (HINSTANCE)_Module.GetResourceInstance();
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
I actually need to do some uninitialization work in Term function --
_Module.Term();
However, I found a dll loaded dynamically by my extension have already been
released. So when I call a function ReleaseXXXX() in the this dll cause a
crash.
I think the dynamicly loaded dll's reference count should big than 1, since
I have not called the FreeLibrary function.
Could anyone help me.
Thanks.
Terry
My namespace extension using following flag to enable XP style common control.
ISOLATION_AWARE_ENABLED
It works.
But when the last function _Term() which is called when explorer close.
It is called in DllMain like this:
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID
/*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if(S_OK != _Module.Init(ObjectMap, hInstance))
return FALSE;
g_hInstAppRes = (HINSTANCE)_Module.GetResourceInstance();
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
I actually need to do some uninitialization work in Term function --
_Module.Term();
However, I found a dll loaded dynamically by my extension have already been
released. So when I call a function ReleaseXXXX() in the this dll cause a
crash.
I think the dynamicly loaded dll's reference count should big than 1, since
I have not called the FreeLibrary function.
Could anyone help me.
Thanks.
Terry