www.pudn.com > CHA07.rar > WAVESDOC.CPP


// WavesDoc.cpp : implementation of the CWavesDoc class 
// 
 
#include "stdafx.h" 
#include "Waves.h" 
 
#include "WavesDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CWavesDoc 
 
IMPLEMENT_DYNCREATE(CWavesDoc, CDocument) 
 
BEGIN_MESSAGE_MAP(CWavesDoc, CDocument) 
	//{{AFX_MSG_MAP(CWavesDoc) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
		//    DO NOT EDIT what you see in these blocks of generated code! 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CWavesDoc construction/destruction 
 
CWavesDoc::CWavesDoc() 
{ 
	// TODO: add one-time construction code here 
 
} 
 
CWavesDoc::~CWavesDoc() 
{ 
} 
 
BOOL CWavesDoc::OnNewDocument() 
{ 
	if (!CDocument::OnNewDocument()) 
		return FALSE; 
 
	// TODO: add reinitialization code here 
	// (SDI documents will reuse this document) 
    m_wave.Create(10); 
	return TRUE; 
} 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CWavesDoc serialization 
 
void CWavesDoc::Serialize(CArchive& ar) 
{ 
    if (ar.IsStoring()) { 
        ASSERT(1); 
    } else { 
        CFile* fp = ar.GetFile(); 
        ASSERT(fp); 
        ar.Flush(); 
        m_wave.Load(fp); 
    } 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CWavesDoc diagnostics 
 
#ifdef _DEBUG 
void CWavesDoc::AssertValid() const 
{ 
	CDocument::AssertValid(); 
} 
 
void CWavesDoc::Dump(CDumpContext& dc) const 
{ 
	CDocument::Dump(dc); 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CWavesDoc commands