Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
George Ross
|
Nov 3, 2005 - 4:39 PM
|
Hi I have the follow code. ***************************************************
void LegendProperties::SetMapView(Maps *pMaps)
{
_pMaps=pMaps;
CExtPropertyGridComboBoxBar * pCombo =STATIC_DOWNCAST(CExtPropertyGridComboBoxBar,_PropGrid.GetChildByRTC(RUNTIME_CLASS(CExtPropertyGridComboBoxBar)));
ASSERT_VALID( pCombo );
pCombo->SetCurSel(- 1);
_PropGrid.PropertyStoreSet(NULL);
pCombo->PropertyStoreRemove(- 1);//it ASSERTS HERE
if (!pMaps)//in case active view is not a map leave Legend Empty return; //LOAD NOW ALL THE COMPONENT STORES
CExtPropertyStore *ps;
ps=pMaps->GetFirstPS(); for (;ps!=NULL;)
{
pCombo->PropertyStoreInsert(ps);
ps=pMaps->GetNextPS(ps);
}
pCombo->SetCurSel( 0);
}
*****************************************************************
All componentStores are static.
The Property Grid is in a Panel. The Grid Works well if the Panel is Hidden. If it is Visible then asserts (in the line above with the indication) as follow
The code is below and the problem is the second ASSERT with the Indication
void CExtPropertyGridComboBoxBar::AssertValid() const
{
CExtComboBox::AssertValid(); if( m_pPropertyGridCtrl != NULL )
{
ASSERT_VALID( m_pPropertyGridCtrl );
} if( GetSafeHwnd() != NULL )
{
ASSERT( GetCount() == m_arrPropertyStores.GetSize() ); //*****************HERE************************
}
}
Thanks
Geroge
|
|
Technical Support
|
Nov 4, 2005 - 8:47 AM
|
Here is the source code for the CExtPropertyGridComboBoxBar::PropertyStoreRemove() method: bool CExtPropertyGridComboBoxBar::PropertyStoreRemove(
INT nPos // = -1 // if -1 - remove all
)
{
ASSERT_VALID( this );
if( nPos < 0 )
{
if( GetSafeHwnd() != NULL )
ResetContent();
m_arrPropertyStores.RemoveAll();
return true;
}
if( nPos >= PropertyStoreGetCount() )
{
ASSERT( FALSE );
return false;
}
DeleteString( UINT(nPos) );
m_arrPropertyStores.RemoveAt( nPos );
return true;
} We guess the method may generate assert messages only in its first line. In this case, you encounter the memory damage. You can send us your project so we can clarify what’s wrong.
|
|
George Ross
|
Nov 4, 2005 - 10:56 AM
|
Hi again pse read more carefully my previous message. I have there two block of codes. The second block is YOURs code where the assertion hits. regards George
|
|
Technical Support
|
Nov 7, 2005 - 6:34 AM
|
This assertion occurs because the number of items in the combo-box control is not equal to the number of CExtPropertyStore * pointers in the CExtPropertyGridComboBoxBar::m_arrPropertyStores array. We guess this assertion should never occur if you use CExtPropertyGridComboBoxBar::PropertyStore...() methods for operating with the combo box content and if you never invoke CComboBox methods directly. Could you send us the captured content of the Call Stack window when this assertion happens?
|
|