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. Keeping the DLL loaded

Keeping the DLL loaded

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
5 Posts 5 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.
  • S Offline
    S Offline
    SanjaySMK
    wrote on last edited by
    #1

    Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K

    J D N H 4 Replies Last reply
    0
    • S SanjaySMK

      Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K

      J Offline
      J Offline
      Jonathan Darka
      wrote on last edited by
      #2

      no, a DLL always requires a process to be loaded into else into which memory address space would it go ? Why would you want to do this ?


      Jonathan Wilkes Darka[Xanya.net]

      1 Reply Last reply
      0
      • S SanjaySMK

        Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        SanjaySMK wrote:

        Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How?

        Until FreeLibrary() is called, it will remain in your process' address space.


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • S SanjaySMK

          Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K

          N Offline
          N Offline
          nbugalia
          wrote on last edited by
          #4

          I think that if the process which is using DLL still exist, then the dll will also remain in memory whether you use it or not. To Remove the dll, use FreeLibrary. But that will only remove dll loaded with LoadLibrary. But what you will achieve with that ?

          1 Reply Last reply
          0
          • S SanjaySMK

            Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            From the MSDN: Each process maintains a reference count for each loaded library module. This reference count is incremented each time LoadLibrary is called and is decremented each time FreeLibrary is called. A DLL module loaded at process initialization due to load-time dynamic linking has a reference count of one. This count is incremented if the same module is loaded by a call to LoadLibrary.

            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