Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: html string in .lnk file Pin
Richard MacCutchan28-May-11 13:15
mveRichard MacCutchan28-May-11 13:15 
GeneralRe: html string in .lnk file Pin
limelect29-May-11 4:30
limelect29-May-11 4:30 
GeneralRe: Finally an answer that works html string in .lnk file Pin
limelect29-May-11 21:35
limelect29-May-11 21:35 
QuestionCStringArray reference Pin
_Flaviu23-May-11 20:01
_Flaviu23-May-11 20:01 
AnswerRe: CStringArray reference Pin
Cool_Dev23-May-11 20:46
Cool_Dev23-May-11 20:46 
GeneralRe: CStringArray reference Pin
_Flaviu23-May-11 23:01
_Flaviu23-May-11 23:01 
GeneralRe: CStringArray reference Pin
Cool_Dev25-May-11 4:11
Cool_Dev25-May-11 4:11 
AnswerRe: CStringArray reference Pin
Cedric Moonen23-May-11 20:49
Cedric Moonen23-May-11 20:49 
You are putting a pointer to a CStringArray in your map, which means that it always points to the same instance of CStringArray that you were originally using (it's not a copy). And you do something like this:

psaTest->RemoveAll();


just after adding the pointer to the map. So, your CStringArray will be empty.

By the way, you shouldn't do something like this:
CStringArray* psaRes = new CStringArray;
...
...
m_mapType.Lookup(_T("index"),psaRes);


Because in that case you will have a memory leak. There's no need to make a new CStringArray: if the pointer is found in the map, it will be copied into the psaRes pointer (the address will be copied, not the content of course).

BTW, I suggest you take a look at the STL containers (map, list, ...) they are much easier to use (once you are confortable with the syntax).
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: CStringArray reference Pin
_Flaviu23-May-11 23:04
_Flaviu23-May-11 23:04 
QuestionMFC WebBrowser2 Control, PDF crash Pin
kitkat1201223-May-11 9:15
kitkat1201223-May-11 9:15 
QuestionCStringArray in CMap ? Pin
_Flaviu23-May-11 8:25
_Flaviu23-May-11 8:25 
AnswerRe: CStringArray in CMap ? Pin
David Crow23-May-11 8:50
David Crow23-May-11 8:50 
GeneralRe: CStringArray in CMap ? [modified] Pin
_Flaviu23-May-11 9:07
_Flaviu23-May-11 9:07 
GeneralRe: CStringArray in CMap ? Pin
Stefan_Lang23-May-11 23:42
Stefan_Lang23-May-11 23:42 
QuestionNeed suggestion for thread test Pin
includeh1023-May-11 5:32
includeh1023-May-11 5:32 
QuestionRe: Need suggestion for thread test Pin
David Crow23-May-11 5:58
David Crow23-May-11 5:58 
AnswerRe: Need suggestion for thread test Pin
CPallini23-May-11 6:06
mveCPallini23-May-11 6:06 
GeneralRe: Need suggestion for thread test Pin
includeh1023-May-11 6:19
includeh1023-May-11 6:19 
GeneralRe: Need suggestion for thread test Pin
CPallini23-May-11 9:14
mveCPallini23-May-11 9:14 
AnswerRe: Need suggestion for thread test Pin
Luc Pattyn23-May-11 6:18
sitebuilderLuc Pattyn23-May-11 6:18 
GeneralRe: Need suggestion for thread test Pin
includeh1023-May-11 6:23
includeh1023-May-11 6:23 
GeneralRe: Need suggestion for thread test Pin
CPallini23-May-11 8:06
mveCPallini23-May-11 8:06 
GeneralRe: Need suggestion for thread test Pin
Maximilien24-May-11 4:15
Maximilien24-May-11 4:15 
AnswerRe: Need suggestion for thread test Pin
Stefan_Lang24-May-11 0:06
Stefan_Lang24-May-11 0:06 
QuestionCFileDialog Pin
sarfaraznawaz23-May-11 3:19
sarfaraznawaz23-May-11 3: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.