Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Bug in CXTPTabClientWnd::UpdateContents().
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in CXTPTabClientWnd::UpdateContents().

 Post Reply Post Reply
Author
Message
Sergey View Drop Down
Newbie
Newbie


Joined: 15 November 2004
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergey Quote  Post ReplyReply Direct Link To This Post Topic: Bug in CXTPTabClientWnd::UpdateContents().
    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!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.