PDA

View Full Version : Problem creating a CDataset I can add Pushpins to



IanW
10-28-2008, 10:20 AM
Hello
I'm using MS MapPoint 2006 and writing an MFC app using MS VC++ 2003.
I am trying to create a CDataset I can add pushpins to and wonder if anyone can help me. My current code looks like this ..

CDataSet dataset;
CDataSets datasets;
dataset=datasets.AddPushpinSet("realtime");

which I then add Pushpins to with ..

pushpin.MoveTo(dataset);

The problem is the program halts with a unhandled exception error on the dataset=datasets.AddPushpinSet("realtime") line. I'm guessing I have to do something to my CDataSet object before I can do anything with it but can't find what.

Can anyone tell me what I'm going wrong here ?

Thanks for your time.

Ian

Auge_Ohr
10-28-2008, 05:06 PM
hi,

is your DataMapType (http://www.mapforums.com/BIZOMPDataMapType.htm) = geoDataMapTypePushpin ?


dataset=datasets.AddPushpinSet("realtime")
pushpin.MoveTo(dataset)

i think .ITEM() is missing



Set objPin = objMap.AddPushpin(objMap.FindResults("Seattle, WA")(1)) objMap.DataSets.AddPushpinSet "New Set"
objPin.MoveTo objMap.DataSets.Item("New Set")