Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unload stucked DLL

Posted on 1998-11-10
4
Medium Priority
?
360 Views
Last Modified: 2013-12-03
Hi!
I am searching for a utility which unload DLL files that stucked in memory after the program exit with GPF.

Thanks,
Gideon
0
Comment
Question by:gidon
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 1415971
1. Write you EMail and i send you.
2. This can make from  C/C++ program. Code:
    HMODULE hDll = ::GetModuleHandle("NAME.DLL");
    if (hDll)
      {
      char buff[101];
      ::GetModuleFileName(hDll,buff,100);
      int  nModule = GetModuleUsage(hDll);
      for (int i = 0; i < nModule; i++)
        FreeLibrary(hDll);
       }
NOTE: if this OWL200.DLL must make loop for nModule -1!!!
Regards, Alex
0
 
LVL 22

Expert Comment

by:nietod
ID: 1415972
A DLL cannot be stuck in memory after the program that uses it crashes.

Windows will destory the memory space for that program and that DLL.  There is no way to "unload" the DLL, it basically doesn't exist any more.
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1415973
Nietod, you are not right. This situation can be in many
reasons and Windows not deleted allways such DLL.
For example, in my programm with OWL (after cratch) rests
OWL200 and after some times i must make BOOT
(function CreateBitmap ended with OWL Exeption).  
Only after solution, that i write in REPLY,  situation OK.
See , too, Previously asked question about use DLL with
VB. (http://www.experts-exchange.com/Q.10084649)
After reply on this question i found more simple solution!
0
 

Author Comment

by:gidon
ID: 1415974
GetModuleUsage() is obselete in Win32

Gideon
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 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