M
MLM450
I am using a C# control in an unmanaged C++ app. The control has events
that I need to handle. The first time I present the dialog containing
the control, everything works fine - including the event handlers.
The second time I try to display the window, it crashes before the
dialog displays. It goes down in the GetNextDlgTabItem function because
it fails the IsWindow assert (m_hWnd is null). Why would this happen
and how do I fix this?
I have set up my event handlers using DECLARE_DISPATCH_MAP,
DECLARE_INTERFACE_MAP, and AfxConnectionAdvise/AfxConnectionUnadvise.
It must be related to the event handlers because when I remove the
Advise/Unadvise calls, the problem goes away. The dialog is completely
destroyed after the first iteration - it is a variable within a
function that ends after the dialog is closed.
It seems like there must be something interfering from the first time I
present the dialog, but what is it?
Any ideas?
Thanks!
that I need to handle. The first time I present the dialog containing
the control, everything works fine - including the event handlers.
The second time I try to display the window, it crashes before the
dialog displays. It goes down in the GetNextDlgTabItem function because
it fails the IsWindow assert (m_hWnd is null). Why would this happen
and how do I fix this?
I have set up my event handlers using DECLARE_DISPATCH_MAP,
DECLARE_INTERFACE_MAP, and AfxConnectionAdvise/AfxConnectionUnadvise.
It must be related to the event handlers because when I remove the
Advise/Unadvise calls, the problem goes away. The dialog is completely
destroyed after the first iteration - it is a variable within a
function that ends after the dialog is closed.
It seems like there must be something interfering from the first time I
present the dialog, but what is it?
Any ideas?
Thanks!