Solved

Unload stucked DLL

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

13 Experts available now in Live!

Get 1:1 Help Now