assertion in DoNotifyWindowAboutCaptureLost in wxMSW 2.7.1
Carl Godkin
cgodkin at gmail.com
Mon Oct 23 09:34:28 PDT 2006
On 10/19/06, Vadim Zeitlin <vadim at wxwindows.org> wrote:
> On Tue, 17 Oct 2006 15:06:44 -0700 Carl Godkin <cgodkin at gmail.com> wrote:
>
> CG> Anyway, both applications assert when I call wxDropSource::DoDragDrop()
>
> Does this happen in the dnd sample?
>
> CG> with this message:
> CG> ..\..\src\common\wincmn.cpp(2405): assert "wxAssertFailure" failed in
> CG> DoNotifyWindowAboutCaptureLost(): window that captured the mouse
> CG> didn't process wxEVT_MOUSE_CAPTURE_LOST
> CG>
> CG> I never heard of this event before and I don't have all that clear an
> CG> understanding of what I need to do in order to get drag & drop going
> CG> again in my application.
>
> Usually when you capture the mouse you call CaptureMouse() and then, at
> some later time, ReleaseMouse() and you suppose that you do have the mouse
> capture in between. Unfortunately, this is too simplistic as your
> application may also lose capture before you call ReleaseMouse() because,
> for example, user pressed some special key combination or even because
> another application popped up a message box unexpectedly. This is what this
> event notifies you about. And you must handle it as the application should
> really know whether it really has capture or not (e.g. a control which
Thanks for the tip on this!
I simply added an event handler for wxMouseCaptureLostEvent to
the wxTreeListCtrl's wxTreeListMainWindow and I no longer get the
assertion.
The handler does nothing which I think is OK because ReleaseMouse()
is always called like this in wxTreeListCtrl:
if (HasCapture()) ReleaseMouse();
I'll now contact the maintainer (Otto) and make sure he knows that
this seems to be required now.
Thanks again,
carl
More information about the wx-users
mailing list