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. DLL being freed

DLL being freed

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++performancehelp
4 Posts 4 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.
  • 0 Offline
    0 Offline
    0v3rloader
    wrote on last edited by
    #1

    Hello, I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. Well, the problem i've been having consists in that whenever the app stops running, the dll is automatically freed (possibly because it is associated with the creating thread/instance.) How can I prevent this from happening? I mean, how can I make the Dll remain in memory until it receives a notification saying it can terminate? Thanks, Dave BTW: it is a dll with MFC support...

    C R G 3 Replies Last reply
    0
    • 0 0v3rloader

      Hello, I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. Well, the problem i've been having consists in that whenever the app stops running, the dll is automatically freed (possibly because it is associated with the creating thread/instance.) How can I prevent this from happening? I mean, how can I make the Dll remain in memory until it receives a notification saying it can terminate? Thanks, Dave BTW: it is a dll with MFC support...

      C Offline
      C Offline
      cmk
      wrote on last edited by
      #2

      dNimrod#X wrote: I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. And do what exactly ? The dll is just a bunch of functions, the exe is the main thread of execution. What are to trying to accomplish ? ...cmk Save the whales - collect the whole set

      1 Reply Last reply
      0
      • 0 0v3rloader

        Hello, I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. Well, the problem i've been having consists in that whenever the app stops running, the dll is automatically freed (possibly because it is associated with the creating thread/instance.) How can I prevent this from happening? I mean, how can I make the Dll remain in memory until it receives a notification saying it can terminate? Thanks, Dave BTW: it is a dll with MFC support...

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        dNimrod#X wrote: how can I make the Dll remain in memory until it receives a notification saying it can terminate? What you're asking doesn't make sense. By definition, a DLL is a library - it is an extension to an application. It makes no sense to have a library in memory without an application using it. Basically, you can't do this. Windows automatically frees all libraries when you close your application. There is nothing you can do about it, by design. If you want your DLL to stay in memory, your application has to stay in memory as well.

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        1 Reply Last reply
        0
        • 0 0v3rloader

          Hello, I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. Well, the problem i've been having consists in that whenever the app stops running, the dll is automatically freed (possibly because it is associated with the creating thread/instance.) How can I prevent this from happening? I mean, how can I make the Dll remain in memory until it receives a notification saying it can terminate? Thanks, Dave BTW: it is a dll with MFC support...

          G Offline
          G Offline
          gamitech
          wrote on last edited by
          #4

          try FreeLibrary() gabby

          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