// Mymfc9Dialog.cpp : implementation file
//

#include "stdafx.h"
#include "mymfc9.h"
#include "Mymfc9Dialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMymfc9Dialog dialog


CMymfc9Dialog::CMymfc9Dialog(CWnd* pParent /*=NULL*/)
	: CDialog(CMymfc9Dialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMymfc9Dialog)
	m_strEdit1 = _T("");
	//}}AFX_DATA_INIT
	m_pView = NULL;
}

// modeless constructor
CMymfc9Dialog::CMymfc9Dialog(CView* pView)
{
    m_pView = pView;
}

void CMymfc9Dialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMymfc9Dialog)
	DDX_Text(pDX, IDC_EDIT1, m_strEdit1);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMymfc9Dialog, CDialog)
	//{{AFX_MSG_MAP(CMymfc9Dialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMymfc9Dialog message handlers

BOOL CMymfc9Dialog::Create()
{
    return CDialog::Create(CMymfc9Dialog::IDD);
}

void CMymfc9Dialog::OnCancel() 
{
	// TODO: Add extra cleanup here
	if (m_pView != NULL)
    {
        // modeless case - do not call base class OnCancel
        m_pView->PostMessage(WM_GOODBYE, IDCANCEL);
    }
    else
	{
        CDialog::OnCancel(); // modal case
    }
}

void CMymfc9Dialog::OnOK() 
{
	// TODO: Add extra validation here
	if (m_pView != NULL)
    {
        // modeless case -- do not call base class OnOK
        UpdateData(TRUE);
        m_pView->PostMessage(WM_GOODBYE, IDOK);
    }
    else
    {
        CDialog::OnOK(); // modal case
    }
}

