CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    62

    Question Automation client in MFC Ext. Dll

    Within an MFC DLL I have a CCmdTarget derivative that is used as an Automation client (i.e. using AfxConnectionAdvise() to sink it up with the given interface). The problem is it never receives any events. I have cut+pasted this class into a MFC CDialog-based project. It worked just fine.

    DLL:
    I've noticed that when I call Release() on my IEventHandler interface, I get a DEBUG ASSERT in atlwin.h
    ("ATL: ERROR - Object deleted before window was destroyed").


    What do I have to do to use an Automation client within an MFC DLL?? Anything special? Anybody have source code? Microsoft has examples that have clients within .exes.

    Help!

  2. #2
    Join Date
    Dec 2000
    Location
    Dallas, Texas
    Posts
    62

    Figured it out

    For anyone else that runs into this problem:
    I needed a message pump of some sort; being in a DLL I didn't have one. So create a CWinThread (UI type). From within the thread's Initinstance(), create your OLE automation client and sink it up with your COM interface.

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