|
// IterTestDoc.cpp : implementation of the CIterTestDoc class
//
#include "stdafx.h"
#include "IterTest.h"
#include "IterTestDoc.h"
#include "mfc_iters.h"
#include <string>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CIterTestDoc
IMPLEMENT_DYNCREATE(CIterTestDoc, CDocument)
BEGIN_MESSAGE_MAP(CIterTestDoc, CDocument)
ON_COMMAND(ID_TESTMFCITERATORS_TESTCVIEWITERATOR, &CIterTestDoc::OnTestmfciteratorsTestcviewiterator)
END_MESSAGE_MAP()
// CIterTestDoc construction/destruction
CIterTestDoc::CIterTestDoc()
{
// TODO: add one-time construction code here
}
CIterTestDoc::~CIterTestDoc()
{
}
BOOL CIterTestDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
// CIterTestDoc serialization
void CIterTestDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
// CIterTestDoc diagnostics
#ifdef _DEBUG
void CIterTestDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CIterTestDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
// CIterTestDoc commands
void CIterTestDoc::OnTestmfciteratorsTestcviewiterator()
{
mfc_cview_iterator it = mfc_cview_iterator(this).begin();
while(*it)
{
// Repaint the view
std::string s = "Testing CView Iterator";
it->SendMessage(MY_TEST_MSG, 0, (LPARAM)s.c_str());
it++;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.