Click here to Skip to main content
15,898,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WTL - dynamically creating buttons etc. Pin
Christian Graus1-Aug-01 13:09
protectorChristian Graus1-Aug-01 13:09 
GeneralCreate a Setup File Pin
sankar31-Jul-01 16:10
sankar31-Jul-01 16:10 
Generaldynamic_cast and void * Pin
31-Jul-01 11:22
suss31-Jul-01 11:22 
GeneralRe: dynamic_cast and void * Pin
Ben Burnett31-Jul-01 14:07
Ben Burnett31-Jul-01 14:07 
GeneralRe: dynamic_cast and void * Pin
Asif Ahmad31-Jul-01 19:57
Asif Ahmad31-Jul-01 19:57 
GeneralRe: dynamic_cast and void * Pin
Malcolm McMahon31-Jul-01 22:59
Malcolm McMahon31-Jul-01 22:59 
GeneralCCtrlView does not show my items Pin
Wim Jans31-Jul-01 11:05
Wim Jans31-Jul-01 11:05 
GeneralRe: CCtrlView does not show my items Pin
Ben Burnett31-Jul-01 14:24
Ben Burnett31-Jul-01 14:24 
Works fine for me, exept I just had to add in two lines (in bold bellow)

// --> CListView::OnInitialUpdate();<br />
<br />
// this code only works for a report-mode list view<br />
ASSERT(GetStyle() & LVS_REPORT);<br />
<br />
CListCtrl& theCtrl = GetListCtrl();<br />
// Insert a column. This override is the most convenient.<br />
theCtrl.InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);<br />
LVCOLUMN col;<br />
col.mask = LVCF_FMT | LVCF_TEXT;<br />
col.pszText = _T("Jersey Number");<br />
col.fmt = LVCFMT_LEFT;<br />
theCtrl.InsertColumn(1, &col);<br />
// Set reasonable widths for our columns<br />
theCtrl.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);<br />
theCtrl.SetColumnWidth(1, LVSCW_AUTOSIZE_USEHEADER);<br />
<br />
for (int i=0;i < 10;i++)<br />
{<br />
strText.Format(TEXT("item %d"), i);<br />
<br />
// Insert the item, select every other item.<br />
theCtrl.InsertItem(<br />
LVIF_TEXT|LVIF_STATE, i, strText, <br />
(i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,<br />
0, 0);<br />
<br />
CString strText;<br />
int nColumnCount = theCtrl.GetHeaderCtrl()->GetItemCount();<br />
<br />
// Initialize the text of the subitems.<br />
for (int j=1;j < nColumnCount;j++)<br />
{<br />
strText.Format(TEXT("sub-item %d %d"), i, j);<br />
theCtrl.SetItemText(i, j, strText);<br />
}<br />
}


Ben Burnett

---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic" Wink | ;)
GeneralRe: CCtrlView does not show my items Pin
Wim Jans1-Aug-01 2:12
Wim Jans1-Aug-01 2:12 
GeneralExtracting features from a BMP Pin
Russel Hawkins31-Jul-01 10:57
Russel Hawkins31-Jul-01 10:57 
GeneralRe: Extracting features from a BMP Pin
Chris Losinger31-Jul-01 11:18
professionalChris Losinger31-Jul-01 11:18 
GeneralRe: Extracting features from a BMP Pin
Russel Hawkins31-Jul-01 21:36
Russel Hawkins31-Jul-01 21:36 
GeneralReading int/long lengths from binary file Pin
31-Jul-01 10:08
suss31-Jul-01 10:08 
GeneralRe: Reading int/long lengths from binary file Pin
Paolo Messina31-Jul-01 10:45
professionalPaolo Messina31-Jul-01 10:45 
GeneralIEnumIDList and Next usage Pin
31-Jul-01 9:34
suss31-Jul-01 9:34 
GeneralResizing List Control Columns Pin
Scott Evans31-Jul-01 9:13
Scott Evans31-Jul-01 9:13 
GeneralRe: Resizing List Control Columns Pin
Tomasz Sowinski31-Jul-01 9:21
Tomasz Sowinski31-Jul-01 9:21 
GeneralRe: Resizing List Control Columns Pin
Paolo Messina31-Jul-01 10:33
professionalPaolo Messina31-Jul-01 10:33 
GeneralSetting font used by TextOut Pin
31-Jul-01 7:18
suss31-Jul-01 7:18 
GeneralRe: Setting font used by TextOut Pin
Tomasz Sowinski31-Jul-01 7:39
Tomasz Sowinski31-Jul-01 7:39 
GeneralDISPLAY AMOUNTS WITH COMMAS Pin
31-Jul-01 7:02
suss31-Jul-01 7:02 
GeneralRe: DISPLAY AMOUNTS WITH COMMAS Pin
Ben Burnett31-Jul-01 14:36
Ben Burnett31-Jul-01 14:36 
GeneralRe: DISPLAY AMOUNTS WITH COMMAS Pin
Bret Faller3-Aug-01 10:02
Bret Faller3-Aug-01 10:02 
Generalchange text color in a combo box Pin
31-Jul-01 6:34
suss31-Jul-01 6:34 
GeneralProblem with Cristi Posea's CSizingControlBar Pin
Jamie Nordmeyer31-Jul-01 6:20
Jamie Nordmeyer31-Jul-01 6:20 

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.