Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FreeLibrary question

FreeLibrary question

Scheduled Pinned Locked Moved C / C++ / MFC
questionoracledata-structuresdebuggingperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brian Shifrin
    wrote on last edited by
    #1

    Any way to force process to unload library???? I working on update component ( oracle ), it seems i can do LoadLibrary and FreeLibrary when needed just ok, except for dll's been locked by OS. I am aware of debug setting for that tells XP to unload every library it is not been used, but this is way to drastic. Couple of other options comes to mind, but I don't want to reinvent the wheel and not even sure it would work. 1) From process A create process B, when done exit B hoping cleanup would unload DLL or may be just issue plain kill. 2) allocate memory, load dll (PE), do fixup entry table etc etc etc as long as darn LoadLibrary is not been used. 3) Call freelibrary until XP frees stupid library or I blow away my stack. 4) Other options? Thanks, Brian

    B 1 Reply Last reply
    0
    • B Brian Shifrin

      Any way to force process to unload library???? I working on update component ( oracle ), it seems i can do LoadLibrary and FreeLibrary when needed just ok, except for dll's been locked by OS. I am aware of debug setting for that tells XP to unload every library it is not been used, but this is way to drastic. Couple of other options comes to mind, but I don't want to reinvent the wheel and not even sure it would work. 1) From process A create process B, when done exit B hoping cleanup would unload DLL or may be just issue plain kill. 2) allocate memory, load dll (PE), do fixup entry table etc etc etc as long as darn LoadLibrary is not been used. 3) Call freelibrary until XP frees stupid library or I blow away my stack. 4) Other options? Thanks, Brian

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      Do what everyone else does. You use MoveFileEx to get the files copied to the correct places during the system restart. Prior to restarting, add a RunOnce program that will register the DLL while the system is starting up. Tell user to reboot system. This is the 'recommended way to repalce DLL that are in use. Look at all the MS security udpates, constant reboots of machine, eh? Works for them.. should work for you!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups