Bug in CXTPTabClientWnd::UpdateContents(). |
Post Reply |
Author | |
Sergey
Newbie Joined: 15 November 2004 Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: 19 June 2006 at 8:57am |
I think you have a bug in method:
void CXTPTabClientWnd::UpdateContents(). The method contains the following code:if ((pChildWnd->GetStyle() & WS_VISIBLE) == WS_VISIBLE){ // add item pNewItem = pFoundItem = AddItem(pChildWnd); pFoundItem->m_hWnd = pChildWnd->GetSafeHwnd(); pFrameWnd->SendMessage(WM_XTP_NEWTABITEM, (WPARAM)pNewItem); pNewItem->GetTabManager()->SetSelectedItem(pNewItem); } Method AddItem(pChildWnd) may return NULL (and I really got it!). In this case my application raises Access Violation on the next line because pFoundItem=NULL. So verification for NULL is needed:if ((pChildWnd->GetStyle() & WS_VISIBLE) == WS_VISIBLE) { // add item pNewItem = pFoundItem = AddItem(pChildWnd); if (pFoundItem)
{
pFoundItem->m_hWnd = pChildWnd->GetSafeHwnd();
pFrameWnd->SendMessage(WM_XTP_NEWTABITEM, (WPARAM)pNewItem); pNewItem->GetTabManager()->SetSelectedItem(pNewItem); }
}
This code works fine!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |