Print Page | Close Window

Access Violation in CXTPTabManager::DeleteItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13782
Printed Date: 12 December 2024 at 12:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Access Violation in CXTPTabManager::DeleteItem
Posted By: jayhamiltoniv
Subject: Access Violation in CXTPTabManager::DeleteItem
Date 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;

}

 
 



Replies:
Posted By: Oleg
Date 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


Posted By: jayhamiltoniv
Date 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 - uploads/20090410_182709_codejock_tabcon.zip

Thanks,
Jay



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net