works for me. Maybe your problem is that you did not include CPacket.h in the document.h. I just put them in the same file, but you can also have them in two different files and include cpacket.h in the other .h.
#if !defined(AFX_TRY5DOC_H__BA63042D_EFBE_45CF_A864_A01C9FB8E010__INCLUDED_)
#define AFX_TRY5DOC_H__BA63042D_EFBE_45CF_A864_A01C9FB8E010__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <vector>
class CPacket //Encapsulates data structs and associated information for easier instantiation.
{
public:
CPacket();
virtual ~CPacket();
bool operator<(const char* str); //Included for the purpose of vectorization, but not used.
bool operator==(const char* str);
struct PeekPacket7
{
unsigned short fProtoSpec;
unsigned short fPacketLength;
unsigned short fSliceLength;
unsigned char fFlags;
unsigned char fStatus;
unsigned long fTimeStampHi;
unsigned long fTimeStampLo;
} ppacket;
struct PacketHeader
{
unsigned char fDestAddr[6];
unsigned char fSrcAddr[6];
unsigned short fProtocol;
unsigned char fPacketData[1500]; /* max packet size */
} enetpacket;
int length;
unsigned long packetCount;
char timeString[16];
};
class CTry5Doc : public CDocument
{
protected: // create from serialization only
CTry5Doc();
DECLARE_DYNCREATE(CTry5Doc)
// Attributes
public:
std::vector<CPacket> theList;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTry5Doc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTry5Doc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CTry5Doc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert …