I'm trying to make packets that will each contain a 3D byte array. Currently I have something like the following. Please help!


#include "stdafx.h"
#include "Twixt.h"
#include "Packet.h"


IMPLEMENT_SERIAL(CPacket,CObject,1)

//#include <string.h>
//#include <stdio.h>

//char stringy[80];

//strcat(stringy, "hello" );






void CPacket::Serialize(CArchive &ar)
{
if (ar.IsLoading()) {
ar>>cmd>>x>>y;
// ar.WriteObject((CObject *)data);
ar.WriteObject((CByteArray *)data);
}
else {
ar<<cmd<<x<<y;
ar.ReadObject((CByteArray *)data);
//data=ar.ReadObject((IsKindOf(*data))data);
}
}