Click to See Complete Forum and Search --> : Comctl32.dll access violation error with CControlBar


jj1996
April 30th, 1999, 08:35 PM
Please, help.
I am developing a database program on DAO 3.5 in the Visual C++.
Development environment : Windows98, Visual C++ 6.0 enterprise.

The project is stopped by fatal access violation error.
In this program I use virtual list view - ClistView class has LVS_OWNERDATA style – to show a user a list of database records.
The error occurs when I move a mouse on DialogBar.
Comctl32.dll version is 4.72.3110.1

---------------- Call Stack window text -----------
836f1d10()
COMCTL32! bfeb32cb()
KERNEL32! bff95996()
CWnd::WindowProc(unsigned int 512, unsigned int 0, long 1376681) line 1586 + 26 bytes
CControlBar::WindowProc(unsigned int 512, unsigned int 0, long 1376681) line 470 + 20 bytes
AfxCallWndProc(CWnd * 0x00801820 {CToolBar hWnd=0x00000674}, HWND__ * 0x00000674, unsigned int 512, unsigned int 0, long 1376681) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00000674, unsigned int 512, unsigned int 0, long 1376681) line 368
--------------------------------------------------------------------------------

---------------- Debug window text -----------
First-chance exception in CalcOrd.exe: 0xC0000005: Access Violation.
--------------------------------------------------------------------------------

---------------- Source Line --------------------------------------
LRESULT CControlBar::WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
{
ASSERT_VALID(this);

LRESULT lResult;
switch (nMsg)
{
case WM_NOTIFY:
case WM_COMMAND:
case WM_DRAWITEM:
case WM_MEASUREITEM:
case WM_DELETEITEM:
case WM_COMPAREITEM:
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
// send these messages to the owner if not handled
if (OnWndMsg(nMsg, wParam, lParam, &lResult))
return lResult;
else
{
// try owner next
lResult = GetOwner()->SendMessage(nMsg, wParam, lParam);

// special case for TTN_NEEDTEXTA and TTN_NEEDTEXTW
if(nMsg == WM_NOTIFY)
{
NMHDR* pNMHDR = (NMHDR*)lParam;
if (pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW)
{
TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
if ((pNMHDR->code == TTN_NEEDTEXTA && (!pTTTA->lpszText || !*pTTTA->lpszText)) ||
(pNMHDR->code == TTN_NEEDTEXTW && (!pTTTW->lpszText || !*pTTTW->lpszText)))
{
// not handled by owner, so let bar itself handle it
lResult = CWnd::WindowProc(nMsg, wParam, lParam);
}
}
}
return lResult;
}
}

// otherwise, just handle in default way
lResult = CWnd::WindowProc(nMsg, wParam, lParam); // **** <<-- last visible soruce line ****
}
-----------------------------------------------------------------------