home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4363 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.6 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!sgi!mips!poseidon!flc
  2. From: flc@mips.com (Fred Cox)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Force DLL to unload
  5. Date: 19 Dec 92 01:32:03 GMT
  6. Organization: Silicon Graphics, Inc.
  7. Lines: 35
  8. Distribution: world
  9. Message-ID: <flc.724728723@poseidon>
  10. References: <DEREKL.92Dec18100741@watson.harlqn.co.uk> <1992Dec18.144024.14800@twisto.eng.hou.compaq.com>
  11. NNTP-Posting-Host: poseidon.mti.sgi.com
  12.  
  13. mccreary@sword.eng.hou.compaq.com (Ed McCreary) writes:
  14.  
  15. >In article <DEREKL.92Dec18100741@watson.harlqn.co.uk> derekl@harlqn.co.uk (Derek Law) writes:
  16. >>Does anybody know how to FORCE Windows 3.1 to unload a DLL? I'm
  17. >>developing a DLL, but every time I change it I have to quit and
  18. >>restart Windows - otherwise Windows complains that the file is "still
  19. >>in use" and so write protected.
  20. >>
  21.  
  22. >How are you loading it?  Try this...
  23.  
  24. >HINSTANCE    hLib;
  25.  
  26. >hLib = LoadLibrary("MY.DLL");
  27. >....program code....
  28. >FreeLibrary(hLib);
  29.  
  30. That works for when your DLL works, but when you get a UAE, the thing
  31. doesn't get FreeLibraried, and you're hosed.
  32.  
  33. As you can tell, I've been annoyed by the same problem.
  34.  
  35. The _really_ annoying thing, though was the first time I came upon
  36. this problem was with Borland, and there was no error message on
  37. linking.
  38.  
  39. It appeared to link and generate a new .dll, but it was actually doing
  40. nothing!  None of my fixes worked, and it was only when I noticed that
  41. the date on the .dll file wasn't changing that I realized what was
  42. going on.
  43.  
  44. There, I've got that off my chest, I feel better.
  45.  
  46. Fred Cox
  47. flc@mti.sgi.com
  48.