|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
David Lin
|
Jun 25, 2003 - 8:17 AM
|
Hello! One of my button in the toolbar constly change its enable state (pCmdUI->Enable(FALSE/TRUE);) I found out that when the mouse cursor is on the toolbar button which is changing its state, then an assert accur:
Src/extcontrolbar.cpp: void CExtControlBar::_DraggingUpdateState(const CPoint & point) { //... ASSERT( CWnd::GetCapture() == this ); //... }
How do I solve it? Thanks!
Best Regard, David
|
|
Sergiy Lavrynenko
|
Jun 26, 2003 - 1:15 AM
|
Hi,
I can suggest two possible solutions:
1) do not perform any operations when the bar is being dragged, which is recommended and logically correct 2) cancel the dragging at all
You can find out whether the control bar of any kind (i.e. resizable bar, toolbar or menu line being in any state: floating or sliding on the frame side) is in the dragged state by invoking this static method (please note that only a single control bar can be in the dragged state at the moment):
static CExtControlBar * CExtControlBar::_DraggingGetBar()
If the returned pointer is NULL , no bar is being dragged.
If the returned pointer is NOT NULL , you have to wait until the dragging is finished (the message loop must run) or send the WM_CANCELMODE(wParam=0,lParam=0) message to this bar, which cancels the dragging operation.
Regards, Sergiy.
|
|