// mymfcproDoc.cpp : implementation of the CMymfcproDoc class
//

#include "stdafx.h"
#include "mymfcpro.h"

#include "mymfcproDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMymfcproDoc

IMPLEMENT_DYNCREATE(CMymfcproDoc, CDocument)

BEGIN_MESSAGE_MAP(CMymfcproDoc, CDocument)
	//{{AFX_MSG_MAP(CMymfcproDoc)
	ON_COMMAND(ID_EDIT_CLEAR_ALL, OnEditClearDocument)
	ON_UPDATE_COMMAND_UI(ID_EDIT_CLEAR_ALL, OnUpdateEditClearDocument)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMymfcproDoc construction/destruction

CMymfcproDoc::CMymfcproDoc()
{
	// TODO: add one-time construction code here

}

CMymfcproDoc::~CMymfcproDoc()
{
}

BOOL CMymfcproDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
        return FALSE;
    m_strText = "Hello...from CMymfcproDoc::OnNewDocument";
    return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CMymfcproDoc serialization

void CMymfcproDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CMymfcproDoc diagnostics

#ifdef _DEBUG
void CMymfcproDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CMymfcproDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMymfcproDoc commands

void CMymfcproDoc::OnEditClearDocument() 
{
	// TODO: Add your command handler code here
	m_strText.Empty();
	
}

void CMymfcproDoc::OnUpdateEditClearDocument(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(!m_strText.IsEmpty());
	
}

