Data structure - parent

This is a discussion on Data structure - parent within the Windows Programming forums, part of the Platform Specific Boards category; I'm making a GUI application and it's 'front-ended' around a 5MB data structure. My application has an MDI frame as ...

  1. #1
    Chad Johnson
    Join Date
    May 2004
    Posts
    154

    Data structure - parent

    I'm making a GUI application and it's 'front-ended' around a 5MB data structure.

    My application has an MDI frame as the main dialog. Should I make the data structure a child of this frame, or should I make it parentless and just belong to the application's top-level class?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    thats up to you.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Is that data global as in all windows need access to it? If yes, then embed it in the main document. Otherwise, it belongs in the subdocument.

    Kuphryn

  4. #4
    Chad Johnson
    Join Date
    May 2004
    Posts
    154
    Really only child objects of the main frame need this structure.

    I tried making it a member of the main frame's class, initializing the structure in the frame's constructor, but when I did the program would either crash or when I started the program I'd get no visual. It would appear for half a second in the task manager, then disappear. However, when I make it part of the main program's class and initialize it in the OnInit() function (I'm using wxWidgets instead of VC++ - works about the same), it works and I have no problems.

    No clue why this happens.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pthread question how would I init this data structure?
    By mr_coffee in forum C Programming
    Replies: 2
    Last Post: 02-23-2009, 12:42 PM
  2. advice on a data structure
    By ventolin in forum C++ Programming
    Replies: 7
    Last Post: 03-23-2004, 10:34 PM
  3. Appropriate data structure
    By gazsux in forum Game Programming
    Replies: 3
    Last Post: 03-19-2003, 01:26 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM
  5. Dynamic Data Structure -- Which one is better?
    By Yin in forum C++ Programming
    Replies: 0
    Last Post: 04-11-2002, 12:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21