PROBLEM
Starting in ArcGIS 9.2, when a given selection is changed, multiple events are raised: two when clearing the current selection, and one more when the new selection is made.
Because of this, any functions written by a developer for handling the change in selection may try to access the selection set before it is assigned the value of the new selection. If this occurs, an error results.
This behavior is by design.
Code:
[Visual Basic 6.0]
' Respond to selection events
Private Sub m_pSelectionEvents_SelectionChanged()
If m_pMap Is Nothing Then Exit Sub ' no map exit...
If m_pMap.SelectionCount = 0 Then Exit Sub ' no selection nothing to do...
MsgBox m_pMap.SelectionCount & " feature(s) are selected."
End Sub
Note:
Because this behavior is different from ArcGIS 9.1, developers may need to revise and/or recompile older customizations to reflect this change.
Get help from ArcGIS experts
Download the Esri Support App