PDA

View Full Version : MapPoint 2010 Europe COMException when adding Pushpin



AMehlem
02-20-2014, 08:39 AM
Hi,

I am using MapPoint 2010 inside my .Net Plugin, which is running inside
a Delphi 5 Application.
The MapPoint ActiveX-Control inside this plugin is used to
display a map with pushpins showing custom images.
In general, adding the markers with the mapControl.ActiveMap.AddPushpin()-
Method works fine.
However, whenever I add a pushpin to the map which has the same location
(coordinates) as a previously added pushpin, I get a COMException with HRESULT
-2147467259 (E_FAIL) and the pushpin is not shown in the map.

The code i use to add the pushpins is the following:
var pushPinLocation = mapPointControl.ActiveMap.GetLocation(pushPinCoord inates.Latitude, pushPinCoordinates.Longitude, 1);
var pushPin = mapPointControl.ActiveMap.AddPushpin(pushPinLocati on, pushPinName); // Throws COMException sometimes

Is it not possible to add pushpins to the same location via COM in MapPoint 2010?
Does anybody know if a future version of MapPoint fixes this issue?

Kind regards,
A. Mehlem

AMehlem
02-21-2014, 03:11 AM
My mistake - the problem was not related to the coordinates,
but to the names of the pushpins I added.
It seems the following combination of pushpin-names is possible:

HYDKONTR05 Bad Neuenahr-Ahrweiler, Ahrallee 1 [AU-0044914]
HYDKONTR05 Bad Neuenahr-Ahrweiler, Ahrallee 3 [AU-0044913]
HYDKONTR05 Bad Neuenahr-Ahrweiler, Ahrallee 7 [AU-0044882]

However, as soon as a pushpin with the name
HYDKONTR05 Bad Neuenahr-Ahrweiler, Ahrallee 7 [AU-0044896]

is added to the same dataset, a COM-Exception is thrown...

It can be fixed however by replacing all "[" with "(" and all "]" with ")"
in the names of the pushpins.