I successfully use:
MapPoint.Location pointOfInterest = activeMap.GetLocation( latitude, longitude, altitude );
activeMap.AddPushpin( pointOfInterest, name );
to add any pushpin I want to the MapPoint ActiveX. But I have not been so lucky when it comes to deleting a pushpin. To prevent me from having to create an entirely new map just because I need to remove as pushpin, I have used:
But I sometimes get an exception "RPC Server Unavailable" which then causes an incomplete removal of the pushpins I'm trying to remove.
My question is what type of data structure should I use so that I can most easily remove the pushpins later, without running into that most annoying exception?
Or is there a simple way to retrieve the pushpins from the active map?