• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • 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 HuiEngineerCommented:
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 HuiEngineerCommented:
I forgot to add that if you want the list of DLLs, use ModuleFirst() and ModuleNext() in ToolHelp.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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