CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    36

    dll exitinstance never called?

    I have a MFC .dll that I need to have perform some housekeeping when the application that uses the .dll shuts down. The CWinApp ExitInstance function is never called, neither is the destructor. Is there a function that is called when the app that loads the .dll shuts down? I know I could create an "UnInitialize" function, but want to make the process automatic of course.
    TIA
    Eric

  2. #2
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: dll exitinstance never called?

    You could probably put the required code in:

    DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)

    where dwReason = DLL_PROCESS_DETACH
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  3. #3
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: dll exitinstance never called?

    Is it a COM DLL?

    If not, are you doing a FreeLibrary?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured