Solved

Unloading DLL's from memory

Posted on 1998-11-24
2
244 Views
Last Modified: 2013-11-20
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
Comment
Question by:Beatachon
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1325253
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
 
LVL 15

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 121
if loop in java 3 130
while loop over for loop 7 93
conditional code and condition difference 9 77
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now