This little bug's got me stumped. I've got a listctrl that I'm dynamically creating in a formview. It is a report style listctrl, which allows the editing of the items.
I'm handling the EndLabelEdit message with the message maps, in the formview:
I ended up using these, as a solution to a previous question I asked, where handling LVN_ENDLABELEDIT was not enough to catch the message.
Up to this point, things work fine, and I can handle and validate the edited text. The problem is here:
void CMyView::OnEndlabeleditRepository(NMHDR* pNMHDR, LRESULT* pResult)
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
CString strText = pDispInfo->item.pszText;
//do something with the text...
*pResult = TRUE;
If I was to enter "Test" then
pDispInfo->item.pszText = T\0e\0s\0t\0
so strText ends up equalling "T"
I think this is a UNICODE issue, and I don't currently have the preprocessor _UNICODE defined. But it's my understanding that a CString should take this and convert it correctly, right?
This works correctly on Win98, and I get this problem on WinNT.
Any ideas on how to remedy this?