[RESOLVED] CListCtrl ItemText problem

Hi,

I have some fancy problem using a listctrl. I have a function to display some contents of a database in a list. This list has three columns. I wrote the following function to populate the list:

void
CInterfaceView::UpdateDbURIList(map<long, pair<CString, CString> > cContents)
{
map<long, pair<CString, CString> >::iterator it;

m_dbListCtrl.DeleteAllItems();
int iIndex;
CString str;
for (it = cContents.begin(); it != cContents.end(); ++it)
{
str.Format("%d", it->first);
iIndex = m_dbListCtrl.InsertItem(it->first, str);
m_dbListCtrl.SetItemText(iIndex, 1, it->second.first);
m_dbListCtrl.SetItemText(iIndex, 2, it->second.second);
}
}

The function is called as soon as there are changes on the database or if a new database is selected.
The problem is this:
When I call this function the 'normal' way, for example by selecting a new database, everything works fine. When the function is called after opening a settings file (so after setting the new database path via serialization), only the InsertItem seems to function correct, column 2 and 3 remain empty.

I have checked the returnvalues of SetItemText and the content of cContents, both are ok, no failure is indicated.

Any ideas??

Best,
Wietse
[1425 byte] By [Wietseb] at [2007-11-20 0:14:26]