How to assign a custom icon to a Pushpin in Mappoint?

I am writing an MFC application that uses the MS Mappoint OCX. I need to display the location of people and vehicles on a map, and the best way to do this is with Pushpin objects. I have no problem displaying the bracket button icon with some text, but you want to change the icon to a specially designed one. From a limited amount of Mappoint programming information, there appears a way to do this, to create a symbol object from a symbol object, and then assign it to a pushpin like this.

CSymbols symbols;
CSymbol symbol;

symbol=symbols.Add("c:/temp/myicon.ico");
pushpin.put_Symbol(symbol.get_ID());

But the program crashes with an unhandled exception in the symbol.add command.

Can someone tell me what I'm doing wrong here? or am I completely mistaken?

thank you for your time

Jan

+3
source share
2

. .

CSymbols symbols;
CSymbol symbol;

symbols=map.get_Symbols();
symbol=symbols.Add("c:/temp/myicon.ico");
pushpin.put_Symbol(symbol.get_ID());

- Mappoint-.

+4

, , , : , , .

, Symbols MapPoint.Map.

MapPoint, . -, http://www.mp2kmag.com, http://www.mapforums.com http://www.mapping-tools.com/howto/ - , .

( : , "howto", ).

0

Source: https://habr.com/ru/post/1698388/


All Articles