Click here to Skip to main content
15,925,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralR u From AEC Chikhli Pin
Atul2321-Dec-06 20:45
Atul2321-Dec-06 20:45 
GeneralRe: R u From AEC Chikhli Pin
Abhijeet Rajput21-Dec-06 21:32
Abhijeet Rajput21-Dec-06 21:32 
GeneralRe: How do we can given the highlighted effect to the toolbar button when it is pressed Pin
Anamika200521-Dec-06 23:01
Anamika200521-Dec-06 23:01 
AnswerRe: How do we can given the highlighted effect to the toolbar button when it is pressed Pin
Cristian Amarie28-Dec-06 22:26
Cristian Amarie28-Dec-06 22:26 
QuestionRegSetValueEx setting a strange value Pin
locoone21-Dec-06 12:32
locoone21-Dec-06 12:32 
AnswerRe: RegSetValueEx setting a strange value Pin
Johan Pretorius21-Dec-06 13:09
Johan Pretorius21-Dec-06 13:09 
GeneralRe: RegSetValueEx setting a strange value Pin
locoone21-Dec-06 13:13
locoone21-Dec-06 13:13 
QuestionRe: RegSetValueEx setting a strange value Pin
Johan Pretorius21-Dec-06 13:17
Johan Pretorius21-Dec-06 13:17 
AnswerRe: RegSetValueEx setting a strange value Pin
locoone21-Dec-06 13:20
locoone21-Dec-06 13:20 
GeneralRe: RegSetValueEx setting a strange value Pin
Johan Pretorius21-Dec-06 13:43
Johan Pretorius21-Dec-06 13:43 
GeneralRe: RegSetValueEx setting a strange value Pin
locoone21-Dec-06 13:48
locoone21-Dec-06 13:48 
GeneralRe: RegSetValueEx setting a strange value Pin
Johan Pretorius21-Dec-06 13:53
Johan Pretorius21-Dec-06 13:53 
GeneralRe: RegSetValueEx setting a strange value Pin
Mark Salsbery21-Dec-06 13:59
Mark Salsbery21-Dec-06 13:59 
GeneralRe: RegSetValueEx setting a strange value Pin
Mark Salsbery21-Dec-06 14:13
Mark Salsbery21-Dec-06 14:13 
QuestionControlling a Command Line from a GUI Pin
g51ngh21-Dec-06 8:06
g51ngh21-Dec-06 8:06 
AnswerRe: Controlling a Command Line from a GUI Pin
led mike21-Dec-06 10:15
led mike21-Dec-06 10:15 
QuestionClear screen Pin
ggreekggod21-Dec-06 7:46
ggreekggod21-Dec-06 7:46 
AnswerRe: Clear screen Pin
Maximilien21-Dec-06 7:54
Maximilien21-Dec-06 7:54 
GeneralRe: Clear screen Pin
ggreekggod21-Dec-06 8:26
ggreekggod21-Dec-06 8:26 
GeneralRe: Clear screen Pin
David Crow21-Dec-06 8:55
David Crow21-Dec-06 8:55 
QuestionSaving CObArray objects containing CObArray objects Pin
Ben Aldhouse21-Dec-06 6:27
Ben Aldhouse21-Dec-06 6:27 
QuestionRe: Saving CObArray objects containing CObArray objects Pin
prasad_som21-Dec-06 18:58
prasad_som21-Dec-06 18:58 
AnswerRe: Saving CObArray objects containing CObArray objects [modified] Pin
Ben Aldhouse22-Dec-06 3:18
Ben Aldhouse22-Dec-06 3:18 
GeneralRe: Saving CObArray objects containing CObArray objects Pin
Ben Aldhouse22-Dec-06 3:28
Ben Aldhouse22-Dec-06 3:28 
AnswerRe: Saving CObArray objects containing CObArray objects Pin
Ben Aldhouse23-Mar-07 21:37
Ben Aldhouse23-Mar-07 21:37 
I've got this sorted out now. The full solution to the problem is written up here. Looking at the above message, it seems to me that, at the time, my mistake was in the CNode::Serialize function where I had simply tried to serialize the CObArray object (of sub nodes) with the insertion and extraction operators along with the other node object members. The way to get this to work, it turns out, is to not treat the collection of sub nodes like the other node object members but instead call its CObArray serialization function. Hence the node object serialization function looks like this:

void CNode::Serialize(CArchive &ar)
{
    // Call the ancestor function
    CSubNode::Serialize(ar);

    int iNoSubNodes = 0;

    // Are we writing?
    if (ar.IsStoring())
    {
        // Get the number of sub nodes
        iNoSubNodes = m_oaSubNodes.GetSize();

            // Write variables in order
        ar << m_iSubNodePosition << m_strString << iNoSubNodes;
    }
    else
            // Read variables in order
        ar >> m_iSubNodePosition >> m_strString >> iNoSubNodes;

    // Serialize the array of sub nodes
    m_oaSubNodes.Serialize(ar);

}

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.