|
-
October 16th, 2003, 11:20 AM
#1
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!
-
October 16th, 2003, 06:19 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|