Message 1 of 1
AfxFreeLibrary unload library

Not applicable
08-07-2007
07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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