Click here to Skip to main content
15,914,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OT Pin
Mark Salsbery15-Nov-06 11:17
Mark Salsbery15-Nov-06 11:17 
AnswerRe: ReadFile() - Buffer... Pin
prasad_som15-Nov-06 2:02
prasad_som15-Nov-06 2:02 
AnswerRe: ReadFile() - Buffer... Pin
toxcct15-Nov-06 2:09
toxcct15-Nov-06 2:09 
QuestionListbox problem Pin
priyank_ldce15-Nov-06 1:35
priyank_ldce15-Nov-06 1:35 
AnswerRe: Listbox problem Pin
prasad_som15-Nov-06 1:39
prasad_som15-Nov-06 1:39 
AnswerRe: Listbox problem Pin
Viorel.15-Nov-06 1:47
Viorel.15-Nov-06 1:47 
GeneralRe: Listbox problem Pin
priyank_ldce15-Nov-06 2:55
priyank_ldce15-Nov-06 2:55 
GeneralRe: Listbox problem Pin
Viorel.15-Nov-06 3:16
Viorel.15-Nov-06 3:16 
In case of variable string values, I think you can try the following (old-fashioned) solution:
// Setting data
char setStr[20] = ...;
::SendMessage( hLbox, LB_SETITEMDATA, listIndex, (LPARAM)_strdup(setStr));

// Getting data
const char * str = (const char*)::SendMessage( hLbox, LB_GETITEMDATA, listIndex, NULL);

Note that these strings are allocated on the "heap" and therefore must be freed when the list control is destroyed, or new data are set. This can be done in OnDestroy handler of your dialog. You have to loop through list-box’s items and execute:
free((const char*)::SendMessage( hLbox, LB_GETITEMDATA, listIndex, NULL));

Modern solutions use functions other than strdup and free. I am not sure which is simpler.

I hope this helps.
Questionmany loop Pin
Max++15-Nov-06 0:40
Max++15-Nov-06 0:40 
AnswerRe: many loop Pin
toxcct15-Nov-06 0:43
toxcct15-Nov-06 0:43 
AnswerRe: many loop Pin
Nibu babu thomas15-Nov-06 0:45
Nibu babu thomas15-Nov-06 0:45 
AnswerRe: many loop Pin
Hamid_RT15-Nov-06 7:54
Hamid_RT15-Nov-06 7:54 
QuestionI would like to know how to detect the network of the PC is not available? Pin
LaHaHa15-Nov-06 0:35
LaHaHa15-Nov-06 0:35 
AnswerRe: I would like to know how to detect the network of the PC is not available? Pin
Mark Salsbery15-Nov-06 7:26
Mark Salsbery15-Nov-06 7:26 
GeneralRe: I would like to know how to detect the network of the PC is not available? Pin
LaHaHa15-Nov-06 13:57
LaHaHa15-Nov-06 13:57 
GeneralRe: I would like to know how to detect the network of the PC is not available? Pin
Mark Salsbery15-Nov-06 14:23
Mark Salsbery15-Nov-06 14:23 
GeneralRe: I would like to know how to detect the network of the PC is not available? Pin
LaHaHa16-Nov-06 21:00
LaHaHa16-Nov-06 21:00 
Questionproblem with #include Pin
Kiran Pinjala15-Nov-06 0:14
Kiran Pinjala15-Nov-06 0:14 
QuestionRe: problem with #include Pin
prasad_som15-Nov-06 0:21
prasad_som15-Nov-06 0:21 
AnswerRe: problem with #include Pin
Kiran Pinjala15-Nov-06 0:47
Kiran Pinjala15-Nov-06 0:47 
AnswerRe: problem with #include Pin
prasad_som15-Nov-06 1:03
prasad_som15-Nov-06 1:03 
GeneralRe: problem with #include Pin
Kiran Pinjala15-Nov-06 1:58
Kiran Pinjala15-Nov-06 1:58 
AnswerRe: problem with #include Pin
Hamid_RT15-Nov-06 7:53
Hamid_RT15-Nov-06 7:53 
QuestionCWnd - message the first time the window is shown Pin
benjymous15-Nov-06 0:01
benjymous15-Nov-06 0:01 
QuestionRe: CWnd - message the first time the window is shown Pin
prasad_som15-Nov-06 1:52
prasad_som15-Nov-06 1:52 

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.