CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    28

    What's Wrong Here ???

    Trying to serialize an array of CPoint elements without much success. Appreciate if someone could point out either what I'm doing wrong or what else I need to do. Thanks in advance.

    Here's the code:

    void CSimpleAppDoc::Serialize(CArchive& ar)
    {
    Serialize(ar);
    if (ar.IsStoring())
    {// storing code
    ar << m_Color; //Store the pen color
    ar << m_ptCount; //Store the drawing
    for (int i = 0; i < m_ptCount; i++) {
    ar << PointArray<i>.x;
    ar << PointArray<i>.y;
    }
    }
    else
    {// loading code
    ar >> m_Color; //Retrieve pen color
    ar >> m_ptCount; //Retrieve drawing
    for (int i = 0; i < m_ptCount; i++)
    {
    ar >> PointArray<i>.x;
    ar >> PointArray<i>.y;
    }
    }
    }


  2. #2
    Join Date
    Apr 1999
    Posts
    37

    Re: What's Wrong Here ???

    Delete the line "Serialize(ar);"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured