Solved

Unload stucked DLL

Posted on 1998-11-10
4
353 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 50 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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