?
Solved

Unloading DLL's from memory

Posted on 1998-11-24
2
Medium Priority
?
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

777 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