whagedorn
9/21/2007 6:29:00 AM
Hi,
I have written a small test application, where I integrated a c#
forms-window in a mfc-application via COM Interop.
Everthing is running very well, but if I use Drag&Drop from the MFC-part to
the C# window I got a debug ASSERT
in the destructor of the CCmdTaget-Class, which is the baseclass of the
using COleDataSource-object.
CCmdTarget::~CCmdTarget()
{
#ifndef _AFX_NO_OLE_SUPPORT
if (m_xDispatch.m_vtbl != 0)
((COleDispatchImpl*)&m_xDispatch)->Disconnect();
ASSERT(m_dwRef <= 1); <=
m_dwRef is 3
#endif
m_pModuleState = NULL;
}
It seems, that the garbage collector will not release this object after
dropping it.
I try to realease it manually, but without any success.
Any ideas or suggestions are appreciated.
Thanks,
Wilfried