I am attempting to highlight all the pushpins in all the datasets after a user draws a polygon shape on the MapPoint ActiveX object in a Windows Form (.NET Framework 4.0)
oMap.Shapes.Count = 1 (according to my watch window), however oMap.Shapes[0] shows oMap.Shapes[0] throws an exception System.OutOfMemoryException' MapPoint.Shape {System.OutOfMemoryException}
Am I missing something here?
Thanks in advance for your time,
Andre Ranieri
Code:MapPoint.Shape objShape; MapPoint.Map oMap = this.axMapPoint.ActiveMap; foreach (MapPoint.DataSet oDS in oMap.DataSets) { if (oMap.Shapes.Count >= 1) { MapPoint.Recordset oRS = oDS.QueryShape(oMap.Shapes[0]); Code Fails here oRS.MoveFirst(); if (oRS.EOF) { continue; } oRS.MoveFirst(); if (oRS.EOF) { continue; } while (!oRS.EOF) { oRS.Pushpin.Highlight = true; } } }




LinkBack URL
About LinkBacks






Reply With Quote
