Click here to Skip to main content
15,916,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a problem i cant figured out.

First, i insert three column in a listview control:
C++
LVCOLUMN lvc;
lvc.mask = LVCF_WIDTH/*|LVCF_TEXT*/;
lvc.cx = 100;
//lvc.pszText = _T("");
::SendMessage(hwndList, LVM_INSERTCOLUMN, 0, (LPARAM)&lvc);
lvc.cx = 100;
::SendMessage(hwndList, LVM_INSERTCOLUMN, 1, (LPARAM)&lvc);
lvc.cx = 100;
::SendMessage(hwndList, LVM_INSERTCOLUMN, 2, (LPARAM)&lvc);

second, i want change the text of the column:
C++
LVCOLUMN lvc = {0};
wchar_t buf[MAX_PATH];
lvc.mask = LVCF_TEXT;
lvc.pszText = buf;
g_LangMgr.GetString(IDS_USER, buf, MAX_PATH);//buf now is "i am wrong"
int ret = ::SendMessage(hwndList, LVM_SETCOLUMN, 0, (LPARAM)&lvc);

although ret equals 1 which means ok, but the column text is not displayed. when i uncomment the code in the first code fragment, it worked ok, and i want know where?
Posted
Updated 2-Aug-11 10:02am
v2

1 solution

because with first code you create the column. If its is created without text you havent anything to change. :-O
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900