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

C / C++ / MFC

 
QuestionAn struct declared within another struct. Pin
Comp_Users12-Feb-09 15:16
Comp_Users12-Feb-09 15:16 
AnswerRe: An struct declared within another struct. Pin
Rick York12-Feb-09 18:12
mveRick York12-Feb-09 18:12 
GeneralRe: An struct declared within another struct. Pin
Comp_Users12-Feb-09 18:26
Comp_Users12-Feb-09 18:26 
GeneralRe: An struct declared within another struct. Pin
Arman S.12-Feb-09 20:39
Arman S.12-Feb-09 20:39 
GeneralRe: An struct declared within another struct. Pin
Cedric Moonen12-Feb-09 20:48
Cedric Moonen12-Feb-09 20:48 
GeneralRe: An struct declared within another struct. Pin
Arman S.12-Feb-09 20:53
Arman S.12-Feb-09 20:53 
GeneralRe: An struct declared within another struct. Pin
Cedric Moonen12-Feb-09 21:03
Cedric Moonen12-Feb-09 21:03 
AnswerRe: An struct declared within another struct. Pin
Cedric Moonen12-Feb-09 20:35
Cedric Moonen12-Feb-09 20:35 
Please, first fix the typos. For instance, you are missing a < character on the map declaration so we can't see the type you are using as a key. If you are using a TCHAR*, then review what we discussed yesterday, because it won't work. Use a std::string or std::wstring instead (because of the comparison operator that won't work for a TCHAR*).

Second, if you have a crash, it is very helpfull if you provide the exact location of the crash in your code (using the call stack from the debugger) and any other assert message that you get.

Third, the way you use the insert (and not Insert function) is a bit akward: why are you accessing the return value (you write a .second at the end) ? The insert function returns an iterator (the place where your data was inserted), why do you access this iterator ? It doesn't make any sense and makes the code difficult to understand.
Furthermore, you I find easier to use the [] operator directly:
ObjList[_T("First")] = MyStrucObj;

Anyway, as said yesterday, your problem certainly comes from the fact that you are using TCHAR* as key for the map. Please, consider seriously using a string wrapper class instead, or you will make your life a hell for nothing.

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

AnswerRe: An struct declared within another struct. Pin
Cedric Moonen12-Feb-09 20:45
Cedric Moonen12-Feb-09 20:45 
GeneralRe: An struct declared within another struct. [modified] Pin
Comp_Users12-Feb-09 21:13
Comp_Users12-Feb-09 21:13 
GeneralRe: An struct declared within another struct. Pin
Cedric Moonen12-Feb-09 21:21
Cedric Moonen12-Feb-09 21:21 
QuestionA Question about Buttons Pin
BobInNJ12-Feb-09 14:43
BobInNJ12-Feb-09 14:43 
AnswerRe: A Question about Buttons Pin
Arman S.12-Feb-09 22:38
Arman S.12-Feb-09 22:38 
GeneralRe: A Question about Buttons Pin
BobInNJ13-Feb-09 5:16
BobInNJ13-Feb-09 5:16 
GeneralRe: A Question about Buttons Pin
Arman S.14-Feb-09 0:49
Arman S.14-Feb-09 0:49 
GeneralRe: A Question about Buttons Pin
BobInNJ14-Feb-09 4:47
BobInNJ14-Feb-09 4:47 
GeneralRe: A Question about Buttons Pin
Arman S.14-Feb-09 6:31
Arman S.14-Feb-09 6:31 
GeneralRe: A Question about Buttons Pin
BobInNJ14-Feb-09 6:49
BobInNJ14-Feb-09 6:49 
GeneralRe: A Question about Buttons Pin
Arman S.14-Feb-09 7:09
Arman S.14-Feb-09 7:09 
GeneralRe: A Question about Buttons Pin
BobInNJ14-Feb-09 11:52
BobInNJ14-Feb-09 11:52 
QuestionAbout CComboBox::GetLBText() Pin
Chrissie.ja12-Feb-09 13:58
Chrissie.ja12-Feb-09 13:58 
AnswerRe: About CComboBox::GetLBText() Pin
«_Superman_»12-Feb-09 17:48
professional«_Superman_»12-Feb-09 17:48 
QuestionHow to get this to work correctly :( Pin
edgar 8812-Feb-09 13:52
edgar 8812-Feb-09 13:52 
Questionrand() is not random Pin
includeh1012-Feb-09 13:37
includeh1012-Feb-09 13:37 
AnswerRe: rand() is not random Pin
BobInNJ12-Feb-09 14:50
BobInNJ12-Feb-09 14:50 

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.