Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Use of CStringArray Pin
CodingLover7-Jan-08 0:48
CodingLover7-Jan-08 0:48 
QuestionRe: Use of CStringArray Pin
CPallini7-Jan-08 1:48
mveCPallini7-Jan-08 1:48 
GeneralRe: Use of CStringArray Pin
CodingLover7-Jan-08 14:46
CodingLover7-Jan-08 14:46 
GeneralCFile Pin
kk.tvm6-Jan-08 21:38
kk.tvm6-Jan-08 21:38 
GeneralRe: CFile Pin
CPallini6-Jan-08 21:55
mveCPallini6-Jan-08 21:55 
QuestionProblem with CListCtrl::SetItemData [Solved] Pin
fantasy12156-Jan-08 21:31
fantasy12156-Jan-08 21:31 
GeneralRe: Problem with CListCtrl::SetItemData Pin
CPallini6-Jan-08 21:47
mveCPallini6-Jan-08 21:47 
GeneralRe: Problem with CListCtrl::SetItemData Pin
Cedric Moonen6-Jan-08 22:41
Cedric Moonen6-Jan-08 22:41 
You should also state that this is dangerous to do if data is local to the function: the instance will be deleted when the function terminates and your pointer will point to an invalid memory location.

A better way to do this would be to:
1) have data be a member of the class. But then, that doesn't make a lot of sense in the current scenario (why would you need to store it in the data pointer of the list control then ?)

2) to create it on the heap (using new). But in that case, you must not forget to delete the pointer once you don't need it anymore (typical place would be in the class destructor and whenever you change an existing pointer).

(That was just a complement to your answer for the OP).


Cédric Moonen
Software developer

Charting control [v1.2]

GeneralRe: Problem with CListCtrl::SetItemData Pin
CPallini6-Jan-08 23:01
mveCPallini6-Jan-08 23:01 
GeneralRe: Problem with CListCtrl::SetItemData Pin
Member 7549607-Jan-08 3:54
Member 7549607-Jan-08 3:54 
GeneralRe: Problem with CListCtrl::SetItemData Pin
fantasy12157-Jan-08 13:58
fantasy12157-Jan-08 13:58 
GeneralNeed windows login information Pin
sujtha6-Jan-08 19:50
sujtha6-Jan-08 19:50 
GeneralRe: Need windows login information Pin
David Crow7-Jan-08 3:31
David Crow7-Jan-08 3:31 
GeneralRe: Need windows login information Pin
Mark Salsbery7-Jan-08 6:43
Mark Salsbery7-Jan-08 6:43 
GeneralStrange operator new in MSDN sample code Pin
Maxwell Chen6-Jan-08 18:48
Maxwell Chen6-Jan-08 18:48 
GeneralRe: Strange operator new in MSDN sample code Pin
CPallini6-Jan-08 21:28
mveCPallini6-Jan-08 21:28 
GeneralRe: Strange operator new in MSDN sample code Pin
Maxwell Chen6-Jan-08 21:41
Maxwell Chen6-Jan-08 21:41 
GeneralRe: Strange operator new in MSDN sample code Pin
CPallini6-Jan-08 21:50
mveCPallini6-Jan-08 21:50 
GeneralRe: Strange operator new in MSDN sample code Pin
Matthew Faithfull6-Jan-08 23:45
Matthew Faithfull6-Jan-08 23:45 
GeneralRe: Strange operator new in MSDN sample code Pin
Maxwell Chen7-Jan-08 0:39
Maxwell Chen7-Jan-08 0:39 
GeneralRe: Strange operator new in MSDN sample code Pin
Matthew Faithfull7-Jan-08 0:55
Matthew Faithfull7-Jan-08 0:55 
GeneralRe: Strange operator new in MSDN sample code Pin
Maxwell Chen7-Jan-08 1:12
Maxwell Chen7-Jan-08 1:12 
GeneralRe: Strange operator new in MSDN sample code Pin
Matthew Faithfull7-Jan-08 1:36
Matthew Faithfull7-Jan-08 1:36 
GeneralRe: Strange operator new in MSDN sample code Pin
Member 7549607-Jan-08 5:00
Member 7549607-Jan-08 5:00 
GeneralRe: Strange operator new in MSDN sample code Pin
Maxwell Chen7-Jan-08 6:19
Maxwell Chen7-Jan-08 6:19 

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.