// Serial0Doc.cpp : implementation of the CSerial0Doc class
//

#include "stdafx.h"
#include "Serial0.h"

#include "Serial0Doc.h"

#include "Serial0Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSerial0Doc

IMPLEMENT_DYNCREATE(CSerial0Doc, CDocument)

BEGIN_MESSAGE_MAP(CSerial0Doc, CDocument)
        //{{AFX_MSG_MAP(CSerial0Doc)
        ON_COMMAND(IDM_STRING, OnString)
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSerial0Doc construction/destruction

CSerial0Doc::CSerial0Doc()
{
        // TODO: add one-time construction code here

}

CSerial0Doc::~CSerial0Doc()
{
}

BOOL CSerial0Doc::OnNewDocument()
{
        if (!CDocument::OnNewDocument())
                return FALSE;

        // TODO: add reinitialization code here
        // (SDI documents will reuse this document)
        m_str="This is an initial string";
        m_pt=CPoint(0,0);

        return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CSerial0Doc serialization

void CSerial0Doc::Serialize(CArchive& ar)
{
        if (ar.IsStoring())
        {
                // TODO: add storing code here
                ar<<m_str<<m_pt;
        }
        else
        {
                // TODO: add loading code here
                ar>>m_str>>m_pt;
        }
}

/////////////////////////////////////////////////////////////////////////////
// CSerial0Doc diagnostics

#ifdef _DEBUG
void CSerial0Doc::AssertValid() const
{
        CDocument::AssertValid();
}

void CSerial0Doc::Dump(CDumpContext& dc) const
{
        CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSerial0Doc commands

void CSerial0Doc::OnString() 
{
        // TODO: Add your command handler code here
        CSerial0Dlg strdlg;
        strdlg.DoModal();
        m_str=strdlg.m_str;
        UpdateAllViews(NULL);
        
}