Author: kombatkombat Date: May 1, 2008 16:25
i'm having issues where calling destroywindow causes a ->release call
on the com object that is my window, without m_hWnd being nullified,
hence assertion.
my outer code creates the com object and runs a message loop, so i
don't understand why the refcount goes down to 0 while the message-
loop is still processing messages.
this is my main code:
CMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CComObject* main = NULL;
HRESULT hr = CComObject::CreateInstance(&main);
main->Create(NULL);
_Module.Lock();
main->ShowWindow(nCmdShow);
int nRet = theLoop.Run();
_Module.RemoveMessageLoop();
when i destroy the window i simply call DestroyWindow from within a
message handler.
any help would be appreciated
|