I use a vector to store data:
Code:
vector<CMapLayer> gisInfoLayers;
gisInfoLayers.push_back(CMapLayer(_T("Huidige positie"), _T("c01s01"), _T("c01s01icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Track"), _T("c01s02"), _T("c01s02icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Stadsdeel"), _T("c01s03"), _T("c01s03icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Straten"), _T("c01s04"), _T("c01s04icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Plein&Markt"), _T("c01s05"), _T("c01s05icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Park&Tuin"), _T("c01s06"), _T("c01s06icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Water"), _T("c01s07"), _T("c01s07icon"), true));
gisInfoLayers.push_back(CMapLayer(_T("Spoorweg"), _T("c01s08"), _T("c01s08icon"), true));
Categories.push_back(CMapCategory(_T("c01icon"), _T("Geografische info"), _T("c01"), true, false, gisInfoLayers));
When I do the following:
Code:
Categories.at(iCount1).Layers.at(iCount2).GetName();
I always get Geografische info, instead of Stadsdeel, Straten, and so on. Why is that? (iCount are counters in for loops).