Solved

Unload stucked DLL

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

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…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…

828 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