How to know if is the DLL released? 
Author Message
 How to know if is the DLL released?

I already explicit linked to a DLL functions.Call FreeLibrary when done
with the DLL,Now, How to know if is the DLL released?


Sun, 20 Feb 2005 17:44:58 GMT  
 How to know if is the DLL released?
How about GetModuleHandle()?

hModule = LoadLibrary("somelibrary.dll");
...
FreeLibrary(hModule);
if (GetModuleHandle("somelibrary.dll") != NULL)
    // library is still in use


Quote:
> I already explicit linked to a DLL functions.Call FreeLibrary when done
> with the DLL,Now, How to know if is the DLL released?



Mon, 21 Feb 2005 04:39:05 GMT  
 How to know if is the DLL released?


Quote:
> How about GetModuleHandle()?

> hModule = LoadLibrary("somelibrary.dll");
> ...
> FreeLibrary(hModule);
> if (GetModuleHandle("somelibrary.dll") != NULL)
>     // library is still in use



>> I already explicit linked to a DLL functions.Call FreeLibrary when done
>> with the DLL,Now, How to know if is the DLL released?

Hi,David Crow
 If the A program calls the FreeLibrary(hModule) function,when the B
program is using the DLL.Then,Does the B program produce errors?


Mon, 21 Feb 2005 09:44:16 GMT  
 How to know if is the DLL released?
No, if both A and B are using the DLL, the reference count will be at least
2.  When A frees the DLL, the reference count will be decremented by 1.
Until the reference count reaches 0, Windows will not unload the DLL.


Quote:

> Hi,David Crow
>  If the A program calls the FreeLibrary(hModule) function,when the B
> program is using the DLL.Then,Does the B program produce errors?



Mon, 21 Feb 2005 20:56:18 GMT  
 How to know if is the DLL released?


Quote:
> No, if both A and B are using the DLL, the reference count will be at
> least 2.  When A frees the DLL, the reference count will be
> decremented by 1. Until the reference count reaches 0, Windows will
> not unload the DLL.



>> Hi,David Crow
>>  If the A program calls the FreeLibrary(hModule) function,when the B
>> program is using the DLL.Then,Does the B program produce errors?

Hi,David Crow
  if both A and B are using the DLL,A calls FreeLibrary(hModule),then,A
calls GetModuleHandle("somelibrary.dll") =?


Tue, 22 Feb 2005 15:34:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. I am seachcing a free pascal editor if someone known a web site just called me

2. How to know whether i am connected

3. how to know whether i am connected

4. How do I know when I am connected?

5. I am new to programming and am lost

6. I am having problems with MFC42.dll file

7. Calling DLL functions without known function name, parameter-list until run-time

8. How I know if version is the referenced in dll

9. I bet no one knows why JNI call to a Jet/DAO DLL hangs

10. General:How can I know what the additional DLLs should I destribute with my ATL application

11. COM DLL - knowing the interfaces at runtime

12. HELP, does anyone know the header info for a DLL file

 

 
Powered by phpBB® Forum Software