• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Unloading DLL's from memory

Does anyone know how to force windows 3.1 to remove a program from memory, or is there a way to write an MFC app to display DLL's in memory and give an option to unload a given DLL?
This is all within the 3.1 environment.
Thanks.
0
Beatachon
Asked:
Beatachon
  • 2
1 Solution
 
Tommy HuiCommented:
The quickest way is to call LoadLibrary() on the DLL to retrieve its HINSTANCE. Then call FreeLibrary() until FreeLibrary() returns FALSE. I belive in Win16, there's an API called GetModuleCount() to return the number of references on the DLL.

0
 
Tommy HuiCommented:
I forgot to add that if you want the list of DLLs, use ModuleFirst() and ModuleNext() in ToolHelp.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now