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. Free the loaded dll

Free the loaded dll

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancehelptutorialquestion
3 Posts 3 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.
  • O Offline
    O Offline
    orcun colak
    wrote on last edited by
    #1

    I have an MFC Extension DLL and I load it into memory using LoadLibrary function. Then I call a method of this dll, which creates a modeless dialog. My problem is I would like to free this dll when the user closes the dialog. But I am not sure how to do this. Do I have to unload a dll from the main program or can I unlod the dll from within the dll itself. If I have to unload it from the main program how can I notify the main program. Thank you Orcun Colak

    V I 2 Replies Last reply
    0
    • O orcun colak

      I have an MFC Extension DLL and I load it into memory using LoadLibrary function. Then I call a method of this dll, which creates a modeless dialog. My problem is I would like to free this dll when the user closes the dialog. But I am not sure how to do this. Do I have to unload a dll from the main program or can I unlod the dll from within the dll itself. If I have to unload it from the main program how can I notify the main program. Thank you Orcun Colak

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      There are several solutions. One solution is messages. Send a message to the main thread and have it unload the DLL. Kuphryn

      1 Reply Last reply
      0
      • O orcun colak

        I have an MFC Extension DLL and I load it into memory using LoadLibrary function. Then I call a method of this dll, which creates a modeless dialog. My problem is I would like to free this dll when the user closes the dialog. But I am not sure how to do this. Do I have to unload a dll from the main program or can I unlod the dll from within the dll itself. If I have to unload it from the main program how can I notify the main program. Thank you Orcun Colak

        I Offline
        I Offline
        igor1960
        wrote on last edited by
        #3

        Be carefull here: if your DLL is proper Extension DLL and you are unloading it from memory: As I recall, MFC doesn't have proper cleanup in this case: pointer to one of your DLL classes may still be registered in main EXE linked list. So, check this out: I just recall having alot of troubles related to this. Maybe MFC has been fixed since then though. "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me

        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