Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Access Violation in CXTPTabManager::DeleteItem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Access Violation in CXTPTabManager::DeleteItem

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


Joined: 24 March 2009
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jayhamiltoniv Quote  Post ReplyReply Direct Link To This Post Topic: Access Violation in CXTPTabManager::DeleteItem
    Posted: 24 March 2009 at 3:37pm
Hello,
 
We currently are seeing a crash when using the tab manager, are there any current workarounds for this?  The comments describe the issue.
 
Thanks,
Jay
 
Version 9.7 - June 25, 2005
 

BOOL CXTPTabManager::DeleteItem(int nItem)

{

                if (nItem < 0 || nItem >= GetItemCount())

                                return FALSE;

 

                BOOL bSelected = m_pSelected == m_arrItems[nItem];

                m_arrItems[nItem]->InternalRelease();                                               // m_pSelected now points to deleted memory

 

                m_arrItems.RemoveAt(nItem);

 

                if (bSelected)

                {

                                SetCurSel(nItem);           // Calls Setfocus on different tab.  If the tab’s OnFocus handler

                                                                                // calls GetSelectedItem, there is a possiblility of a crash.

                                                                                //

                                                                                // Additionally, if a WM_PAINT message is handled by the CXTTabManager

                                                                                // as part of the OnFocus (e.g. a message box displays in the OnFocus handler)

                                                                                // Codejock will try to use m_pSelected and crash.

                }

 

 

                OnItemsChanged();

 

                return TRUE;

}

 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2009 at 2:27am

Hi,

You can modify your sources and add if (bSelected) m_pSelected = NULL; - and rebuild.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jayhamiltoniv View Drop Down
Newbie
Newbie


Joined: 24 March 2009
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jayhamiltoniv Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2009 at 6:28pm
We did apply that fix, but now when upgrading to version 13 the same crash is still present so we have to apply the correction again.  Are there any plans to correct the crash?

uploads/20090410_182709_codejock_tabcon.zip

Thanks,
Jay
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.203 seconds.