The original DLL does not have a DllMain. We got one by having VC++ create for us, and it did. We did this by creating a new DLL project and copy the function into ours:
BOOL APIENTRY DllMain( HMODULE 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:
}
return TRUE;
}
It was easy to paste code. Now we invoke functions:
case DLL_PROCESS_ATTACH:
InitMyLib();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
TerminateMyLib();
break;
Unfortunately did not work as we expected. Does anyone see the problem?
No comments:
Post a Comment