// fc0.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "fc0.h"

#include "mainfrm.h"
#include "fc0doc.h"
#include "fc0view.h"
#include "fc0end.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFc0App

BEGIN_MESSAGE_MAP(CFc0App, CWinApp)
    //{{AFX_MSG_MAP(CFc0App)
    ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
    ON_COMMAND(ID_APP_EXIT, OnAppExit)
    //}}AFX_MSG_MAP
    // Standard file based document commands
    ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
    ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFc0App construction

CFc0App::CFc0App()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CFc0App object

CFc0App NEAR theApp;

/////////////////////////////////////////////////////////////////////////////
// CFc0App initialization

BOOL CFc0App::InitInstance()
{
    // Standard initialization

    SetDialogBkColor();        // set dialog background color to gray
    LoadStdProfileSettings();  // Load standard INI file options (including MRU)

    // Register document templates

    AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
            RUNTIME_CLASS(CFc0Doc),
            RUNTIME_CLASS(CMainFrame),     // main SDI frame window
            RUNTIME_CLASS(CFc0View)));


    // create a new (empty) document
    OnFileNew();

    if (m_lpCmdLine[0] != '\0')
    {
    }

    return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
    CAboutDlg();

// Dialog Data
    //{{AFX_DATA(CAboutDlg)
    enum { IDD = IDD_ABOUTBOX };
    //}}AFX_DATA

// Implementation
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //{{AFX_MSG(CAboutDlg)
        // No message handlers
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
    //{{AFX_DATA_INIT(CAboutDlg)
    //}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CAboutDlg)
    //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
    //{{AFX_MSG_MAP(CAboutDlg)
        // No message handlers
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

// App command to run the dialog
void CFc0App::OnAppAbout()
{
    CAboutDlg aboutDlg;
    aboutDlg.DoModal();
}                                   
                               
/////////////////////////////////////////////////////////////////////////////
// CFc0App commands

void CFc0App::OnAppExit()
{
    // TODO: Add your command handler code here
   Fc0End end;
   if (end.DoModal() == IDOK)
   {
   }
}   
