Hiding prior PropertyGrid item can cause crash |
Post Reply |
Author | |
wsl
Newbie Joined: 17 May 2011 Location: New Zealand Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 02 September 2013 at 2:32am |
I modified the Drawcli_vc110 sample (16.2.0) to add a new PropertyGrid Item to hide the Author Item.
I presume that it is acceptable to do this (i.e. hide a prior item in the property grid) from inside OnGridNotify. The code to hide it is: LRESULT CMainFrame::OnGridNotify(WPARAM wParam, LPARAM lParam) { if (wParam == XTP_PGN_ITEMVALUE_CHANGED ) { CXTPPropertyGridItem* pItem = (CXTPPropertyGridItem*)lParam; if (pItem->GetID() == 999 ) { if (pItem->GetValue() == "False" ) m_pAuthorItem->SetHidden(FALSE); if (pItem->GetValue() == "True" ) m_pAuthorItem->SetHidden(TRUE); } } This all works fine unless the mouse scroll wheel is used to change the value from False to True and then a left mouse click is done in the white space below the property grid item. This causes a crash. Is this a bug in PropertyGrid or is what we are doing unacceptable ? |
|
dleibold
Groupie Joined: 08 March 2010 Location: Canada Status: Offline Points: 13 |
Post Options
Thanks(0)
|
1. Does the crash still occur if the OnGridNotify() code handling is removed? 2. If no for 1., have you determined the specific crash message and location running in debug mode? 3. Is m_pAuthorItem properly assigned to point to the item object? e.g. it should not be NULL nor pointing to an old deleted item 4. lParam should be good, but might want to check its value to ensure it is not NULL, and that the cast pItem represents a valid item 5. Is it just that specific sequence of steps or does it always crash after changing the picklist e.g. try clicking within the grid instead of into the white space below |
|
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 |