View Full Version : Total numbers of records/pushpins in dataset.

12-19-2006, 07:50 AM
Hi guys,

It's maybe a stupid question, but I couldn't find any answers in this forum. I want to know the total pushpins in a dataset (PushpinSet). I've used the method GetRecordCount(), but it just gives me like the name of the pushpins. Maybe I'm wrong, but if I'm not, how can I retrieve the total amount of pushpin in a Dataset?

Thank you guys!

12-19-2006, 01:12 PM

Good question :)
I never needed it, but trying to find answer to your question I cannot find it neather :( Maybe Microsoft forgot it ?
Eventually ou keep a linked list to all your pushpins, then you have the count in your own class (that's what I do).

12-20-2006, 02:43 AM
Thnx for your reply Wilfried,

But to make another linked list, makes things only more confusing. It is possible to put the pushpins to a created dataset (using CDataSets::AddPushpinSet("name")), by using CPushpin::MoveTo(). So than there must be a way to get the total number of pushpins in it.

I also figured out that I've made a mistake in my code. So it is possible to get the total number of pushpins with the GetRecordCount().

I only use the linked-list to get the right pointer to the wanted CDataSet object. Actually I do this:

GetTarget ()
SearchPointer = List.pointer /*pointer to a classobject with info*/
if(NameTarget == SearchPointer->targetname)
return true;
return false;

So if GetTarget returns true, than we can get:
SearchPointer->PointerToDataSet /*
etc... Depending on what you defined in the class. The PointerToDataSet contains the pointer to the wanted DataSet ofcourse. And when you get this pointer, than ofcourse you can search in the dataset object for pushpins and perform other functions related to the DataSet object.

Thank you ;)