Click here to Skip to main content
15,915,867 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionWarnings in my project Pin
Pankaj.Jain23-Feb-07 0:59
professionalPankaj.Jain23-Feb-07 0:59 
AnswerRe: Warnings in my project Pin
Stuart Dootson23-Feb-07 8:17
professionalStuart Dootson23-Feb-07 8:17 
QuestionHow to Add String in MultiColumn ListBox Pin
Pankaj.Jain22-Feb-07 0:04
professionalPankaj.Jain22-Feb-07 0:04 
QuestionRe: How to Add String in MultiColumn ListBox Pin
prasad_som22-Feb-07 1:04
prasad_som22-Feb-07 1:04 
GeneralRe: How to Add String in MultiColumn ListBox Pin
Pankaj.Jain22-Feb-07 1:49
professionalPankaj.Jain22-Feb-07 1:49 
AnswerRe: How to Add String in MultiColumn ListBox Pin
prasad_som22-Feb-07 2:13
prasad_som22-Feb-07 2:13 
GeneralRe: How to Add String in MultiColumn ListBox Pin
Pankaj.Jain22-Feb-07 18:45
professionalPankaj.Jain22-Feb-07 18:45 
AnswerRe: How to Add String in MultiColumn ListBox [modified] Pin
Stuart Dootson22-Feb-07 2:27
professionalStuart Dootson22-Feb-07 2:27 
A MultiColumn ListBox doesn't give that functionality - you want a ListView instead. To add text to a ListView in the way you want, use something like:

// Set up the columns
LVCOLUMN col = {0};
SendDlgItemMessage(IDC_LIST2, LVM_INSERTCOLUMN, 0, (LPARAM)&col);
col.iSubItem = 1;
SendDlgItemMessage(IDC_LIST2, LVM_INSERTCOLUMN, 1, (LPARAM)&col);

LVITEM item = {0};
item.mask = LVIF_TEXT;
item.iSubItem = 0;
item.pszText = "Hi";
int itemIndex = (int)SendDlgItemMessage(IDC_LIST2, LVM_INSERTITEM, 0, (LPARAM)&item);
item.iSubItem = 1;
item.pszText = "All";
SendDlgItemMessage(IDC_LIST2, LVM_SETITEMTEXT, itemIndex, (LPARAM)&item);

SendDlgItemMessage(IDC_LIST2, LVM_SETCOLUMNWIDTH, 0, LVSCW_AUTOSIZE);
SendDlgItemMessage(IDC_LIST2, LVM_SETCOLUMNWIDTH, 1, LVSCW_AUTOSIZE);


[Updated to correct code, add column sizing]
Last modified: 17mins after originally posted --



QuestionCString::AllocSysString Pin
Q2A19-Feb-07 17:17
Q2A19-Feb-07 17:17 
AnswerRe: CString::AllocSysString Pin
prasad_som19-Feb-07 18:29
prasad_som19-Feb-07 18:29 
QuestionCComBSTR Question Pin
Like2Byte19-Feb-07 5:40
Like2Byte19-Feb-07 5:40 
AnswerRe: CComBSTR Question Pin
prasad_som19-Feb-07 6:13
prasad_som19-Feb-07 6:13 
GeneralRe: CComBSTR Question Pin
Like2Byte19-Feb-07 7:02
Like2Byte19-Feb-07 7:02 
QuestionRelease vs. Debug in WTL Pin
mirano19-Feb-07 5:13
mirano19-Feb-07 5:13 
AnswerRe: Release vs. Debug in WTL Pin
prasad_som19-Feb-07 6:20
prasad_som19-Feb-07 6:20 
GeneralRe: Release vs. Debug in WTL Pin
mirano19-Feb-07 6:27
mirano19-Feb-07 6:27 
AnswerRe: Release vs. Debug in WTL Pin
Stuart Dootson19-Feb-07 20:36
professionalStuart Dootson19-Feb-07 20:36 
GeneralRe: Release vs. Debug in WTL Pin
mirano19-Feb-07 21:06
mirano19-Feb-07 21:06 
GeneralRe: Release vs. Debug in WTL Pin
Stuart Dootson20-Feb-07 2:05
professionalStuart Dootson20-Feb-07 2:05 
QuestionRookie STL question (type checking) Pin
jhinze17-Feb-07 10:47
jhinze17-Feb-07 10:47 
AnswerRe: Rookie STL question (type checking) Pin
Michael Dunn17-Feb-07 11:13
sitebuilderMichael Dunn17-Feb-07 11:13 
GeneralRe: Rookie STL question (type checking) Pin
jhinze17-Feb-07 11:23
jhinze17-Feb-07 11:23 
AnswerRe: Rookie STL question (type checking) Pin
Jörgen Sigvardsson22-Feb-07 10:52
Jörgen Sigvardsson22-Feb-07 10:52 
QuestionWTL User Defined Message Pin
damir_tk17-Feb-07 9:54
damir_tk17-Feb-07 9:54 
AnswerRe: WTL User Defined Message Pin
Igor Vigdorchik17-Feb-07 10:36
Igor Vigdorchik17-Feb-07 10:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.