<p>I'm writing a MFC app that uses the MS Mappoint OCX. I need to display the locations of people and vehicles on the map and the best of doing this appears to be with Pushpin objects. I have no problem displaying a stock pushpin icon with some text but want to change the icon to a custom designed one. From the limited amount of Mappoint programming info out there it appears the way to do this is to create a symbol object from a symbols object then assign this to a pushpin like this ..</p>

<pre><code>CSymbols symbols;
CSymbol symbol;

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

<p>But the program crashes with a unhandled exception on the symbols.add instruction.</p>

<p>Can anyone tell me what I am doing wrong here ? or am I on totally the wrong track ?</p>

<p>Thanks for your time</p>

<p>Ian</p>

I found the solution to this one myself. The following code works ..
```
```
CSymbols symbols;
CSymbol symbol;

symbols=map.get_Symbols();
symbol=symbols.Add("c:/temp/myicon.ico");
pushpin.put_Symbol(symbol.get_ID());
```
```
Where map is the Mappoint control.