Click here to Skip to main content
16,019,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Map Pin
User 58385226-Nov-07 14:55
User 58385226-Nov-07 14:55 
GeneralRe: Map Pin
Cedric Moonen26-Nov-07 20:35
Cedric Moonen26-Nov-07 20:35 
GeneralRe: Map Pin
ThatsAlok26-Nov-07 23:33
ThatsAlok26-Nov-07 23:33 
QuestionHow to store a value to a single cell in a CListCtrl? Pin
KellyR26-Nov-07 10:35
KellyR26-Nov-07 10:35 
AnswerRe: How to store a value to a single cell in a CListCtrl? Pin
led mike26-Nov-07 10:52
led mike26-Nov-07 10:52 
GeneralRe: How to store a value to a single cell in a CListCtrl? Pin
KellyR26-Nov-07 11:08
KellyR26-Nov-07 11:08 
GeneralRe: How to store a value to a single cell in a CListCtrl? Pin
KellyR26-Nov-07 12:15
KellyR26-Nov-07 12:15 
GeneralRe: How to store a value to a single cell in a CListCtrl? Pin
Nelek26-Nov-07 20:18
protectorNelek26-Nov-07 20:18 
I was having the same problem but not with the CListCtrl but with a coloured ComboBox, I tried as you say, and my final solution was... An array declared/filled into the stdafx.cpp and use it everywhere I needed it with extern

Maybe is not so "pretty" but is efective as well and the memory... If you don't want to allocate... don't do it. Make an array of 10 different colors and loop it if you have more than 10 items. 10 COLORREF won't be any problem to the needed memory amount and you won't have to allocate/deallocate anything. BTW, I don't think you were thinking on having an unique colour or every cell, weren't you?


KellyR wrote:
Isn't there some way to store a variable on a specific cell in a CListCtrl?


Why don't you save it into the object that is going to that cell insteads of in the cell itself? I mean... If you have a class/object with X datas and 2 of them are shown in the listCtrl and a particular data needs a particular colour... then add the COLORREF to the object insteads of to the cell.

Greetings.

--------
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

GeneralRe: How to store a value to a single cell in a CListCtrl? Pin
Roger Broomfield26-Nov-07 20:28
Roger Broomfield26-Nov-07 20:28 
AnswerRe: How to store a value to a single cell in a CListCtrl? Pin
KellyR27-Nov-07 5:00
KellyR27-Nov-07 5:00 
GeneralRe: How to store a value to a single cell in a CListCtrl? Pin
led mike27-Nov-07 4:34
led mike27-Nov-07 4:34 
QuestionConstants optimization Pin
hint_5426-Nov-07 9:59
hint_5426-Nov-07 9:59 
QuestionRe: Constants optimization Pin
CPallini26-Nov-07 11:22
mveCPallini26-Nov-07 11:22 
AnswerRe: Constants optimization Pin
hint_5426-Nov-07 11:50
hint_5426-Nov-07 11:50 
JokeRe: Constants optimization Pin
Nelek26-Nov-07 20:10
protectorNelek26-Nov-07 20:10 
GeneralRe: Constants optimization Pin
hint_5426-Nov-07 23:56
hint_5426-Nov-07 23:56 
QuestionInvertRgn Pin
bob1697226-Nov-07 8:44
bob1697226-Nov-07 8:44 
AnswerRe: InvertRgn Pin
Mark Salsbery26-Nov-07 8:47
Mark Salsbery26-Nov-07 8:47 
GeneralRe: InvertRgn Pin
bob1697226-Nov-07 8:56
bob1697226-Nov-07 8:56 
GeneralRe: InvertRgn Pin
Mark Salsbery26-Nov-07 9:02
Mark Salsbery26-Nov-07 9:02 
GeneralRe: InvertRgn Pin
bob1697226-Nov-07 9:20
bob1697226-Nov-07 9:20 
GeneralRe: InvertRgn Pin
bob1697226-Nov-07 10:48
bob1697226-Nov-07 10:48 
GeneralRe: InvertRgn Pin
Mark Salsbery26-Nov-07 12:53
Mark Salsbery26-Nov-07 12:53 
GeneralRe: InvertRgn Pin
bob1697226-Nov-07 18:44
bob1697226-Nov-07 18:44 
GeneralRe: InvertRgn Pin
Mark Salsbery27-Nov-07 7:18
Mark Salsbery27-Nov-07 7:18 

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.