CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    CT
    Posts
    75

    Problem unloading a COM DLL

    I have a simple ATL/COM DLL that wraps a C DLL. A VB client access this DLL. Whenever I exit the client, I can't compile anymore. In the form_load() vb function I create an object of the component and then I release it in the exit function. But the DLL doesn't get unloaded from memory. Why?

    Here is the VB code.

    option Explicit
    private withevents mEvent as MsgGrabber

    private Sub Form_Load()
    set mEvent = new MsgGrabber
    End Sub

    private Sub Form_Unload(Cancel as Integer)
    set mEvent = nothing
    End Sub

    private Sub mEvent_MessageRetrieved(byval vString as Variant)
    Dim var as Variant
    var = mEvent.GetMessage
    MsgBox var
    End Sub

    private Sub Send_Click()
    mEvent.SendMessage ("Client string")
    End Sub






  2. #2
    Join Date
    May 1999
    Location
    CT
    Posts
    75

    Re: Problem unloading a COM DLL

    Never mind! The VB code terminated abnormally so the DLL was never unloaded. MSDN says that VC++ 6.0 fixes this problem but it didn't in this situation. I just restarted VC++ and compiled and everything was fine after that.


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