AfxFreeLibrary unload library

AfxFreeLibrary unload library

Anonymous
Not applicable
273 Views
0 Replies
Message 1 of 1

AfxFreeLibrary unload library

Anonymous
Not applicable
Hi,
I was just wondering about this. I need to do the basic think. I have one file which consists of DllMain part and
extern "C" AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void* ptr ) part.

In DllMain part I use function AfxLoadLibrary(resourceFile), but I've read that it needs to be unloaded at the end. and that is my problem. I don't know where to write unload method.


Doesn't work in kUnloadAppMsg: and kUnloadDwgMsg: so it should be probably in DllMain part.

I've tried to write that to DllMain part like this

UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
theArxDLL.AttachInstance(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
AfxFreeLibrary(hInstance);
theArxDLL.DetachInstance();
}

compiled with no problem, but something is telling me that it's not right. 🙂

every help appreciated
0 Likes
274 Views
0 Replies
Replies (0)