Knowledgebase Home | Favorites | Login Knowledgebase Home | Favorites | Login
Search the Knowledgebase Browse by Category or Article ID
Why does LMX_Free hang when used within a dll file?
User Opinions (2 votes)
100% thumbs up 0% thumbs down

Thank you for rating this answer.
Article ID: 168

Last Updated: 27th April 2009 11:24:03 am

When you have a dll, you typically have initialization code like the following:

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:
break;
}
return TRUE;
}


Using this code to initialize and free LM-X handles can cause LMX_Free to hang when using the DETACH handlers, because the OS can close threads without passing the information to the LM-X library. You should instead initialize LM-X by explicitly calling code to initialize and free LM-X from the exported dll interface.

Related Content
Related Articles
Attachments
No attachments were found.
All Content Copyright © 2002-2012 X-Formation. All Rights Reserved.