assertion in DoNotifyWindowAboutCaptureLost in wxMSW 2.7.1
Vadim Zeitlin
vadim at wxwindows.org
Thu Oct 19 06:51:54 PDT 2006
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
captures the mouse and loses the capture must snap back to its normal
state) and you must not call ReleaseMouse() if you had already lost
capture.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list