Article ID: 147684
Article Last Modified on 11/21/2006
#ifdef _DEBUG
int nPrevMode = _CrtSetReportMode(_CRT_ASSERT,0);
#endif
// Code that causes the assertion, for example:
// SendMessage(WM_VSCROLL,...)
#ifdef _DEBUG
_CrtSetReportMode(_CRT_ASSERT,nPrevMode);
#endif
// Assume that nScrollPos is not 0
WPARAM wParam = MAKELONG ( SB_THUMBPOSITION, nScrollPos);
pView->SendMessage( WM_VSCROLL, wParam );
// As mentioned above, ignore the assert.
// Change the OnVScroll handler to the following :
void CMyView::OnVScroll(UINT nSBCode, UINT nPos,
CScrollBar* pScrollBar)
{
if(nSBCode = SB_THUMBPOSITION )
{
const MSG* pMsg = GetCurrentMessage();
nPos = (short)HIWORD(pMsg->wParam);
}
// Do your processing here
CEditView::OnVScroll(nSBCode, nPos, pScrollBar);
}
NOTE: CMyView is derived from CEditView. However the same technique works
for any CWnd derived class. Remember, the same problem also occurs for
scroll messages programmatically sent with the SB_THUMBTRACK code.
Additional query words: 4.00 Windows 95 vcrel 1948 vcfixlist410
Keywords: kbbug kbfix kbnoupdate kbuidesign kbvc410fix KB147684