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

C / C++ / MFC

 
AnswerRe: Obtaining the HWND of a window Pin
SandipG 12-Feb-09 20:04
SandipG 12-Feb-09 20:04 
AnswerRe: Obtaining the HWND of a window Pin
Stuart Dootson12-Feb-09 21:59
professionalStuart Dootson12-Feb-09 21:59 
GeneralRe: Obtaining the HWND of a window Pin
hxhl9513-Feb-09 12:59
hxhl9513-Feb-09 12:59 
QuestionEM_REPLACESEL order of API's Pin
ForNow12-Feb-09 17:37
ForNow12-Feb-09 17:37 
QuestionC++ Logging: Any recommendations? Pin
gvanto12-Feb-09 16:36
gvanto12-Feb-09 16:36 
QuestionRe: C++ Logging: Any recommendations? Pin
David Crow13-Feb-09 3:11
David Crow13-Feb-09 3:11 
AnswerRe: C++ Logging: Any recommendations? Pin
gvanto13-Feb-09 19:09
gvanto13-Feb-09 19:09 
QuestionAn struct declared within another struct. Pin
Comp_Users12-Feb-09 15:16
Comp_Users12-Feb-09 15:16 
Hi,

I have an structure declared in the .h file.
typedef struct
{
  int nID;
  TCHAR szName[MAX_PATH];
}MyStruct1;

//I declare a list of MyStruct1 object with a key of type TCHAR as below.
typedef std::map<std:basic_string xmlns:std="#unknown"><tchar>, MyStruct1> MyStructList;</tchar></std:basic_string>

Another struct which contains the MyStructList list as it's member.
typedef struct
{
 int age;
 TCHAR Place[MAX_PATH];
 MyStructList ObjList;
}MyMainStruct;

In the .cpp file.
void MyApp::main()
{
 MyMainStruct objMainStruct;
 UpdateList( objMainStruct.ObjList);
}

//The list is being updated in this function below.
void MyApp::UpdateList(MyStructList &ObjList)
{
  MyStruct1 MyStructObj;
  _tcscpy(MyStructObj.szName, _T("ABCDE"));
   MyStructObj.nID = 2532;
   ObjList.Insert(MyStructList::value_type(_T("First"), MyStructObj)).second;
  //fill this list with multiple MyStruct1 object and unique keys.
}


I am not able to update the MyStructList list structure in the function below.
When I perform an insert on the list or for that matter any operation on the list, my application (VC2005 on vista) crashes.

Is it because the way I have declared an List object inside another structure that this is not working?
Plesae help me there.
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 
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 

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.