Archived

This topic is now archived and is closed to further replies.

gph-gw

LoadLibrary and memory

Recommended Posts

I''ve got two questions. 1. When I use FreeLibrary to unload a dll I loaded, does windows free the memory used or is it still being used by my program? In other words, do I need to free it myself? 2. How fast are LoadLibrary, GetProcAddress, and FreeLibrary? If they''re very fast I''ll use them often. If they''re slow I won''t.

Share this post


Link to post
Share on other sites
1. When you use FreeLibrary(), windows unloads the module from your application, and if it isn''t used anymore, it releases it from memory. You should usually call this function once when your application is about to close.
2. They''re not exteremely fast, you should only use them once anyway, LoadLibrary and GetProcAddress when your application start (To load the module and get function addresses from it) and FreeLibrary() when your application is destroyed.


- Goblineye Entertainment
The road to success is always under construction

Share this post


Link to post
Share on other sites