home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / chkbook / chkbook.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  3.2 KB  |  138 lines

  1. // chkbook.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "chkbook.h"
  15.  
  16. #include "MainFrm.h"
  17. #include "ChkBkDoc.h"
  18. #include "ChkBkVw.h"
  19.  
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CCheckBookApp
  28.  
  29. BEGIN_MESSAGE_MAP(CCheckBookApp, CWinApp)
  30.     //{{AFX_MSG_MAP(CCheckBookApp)
  31.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  32.     ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
  33.     //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // The one and only CCheckBookApp object
  38.  
  39. CCheckBookApp theApp;
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CCheckBookApp initialization
  43.  
  44. BOOL CCheckBookApp::InitInstance()
  45. {
  46.     // Register the application's document templates.  Document templates
  47.     //  serve as the connection between documents, frame windows and views.
  48.  
  49.     CSingleDocTemplate* pTemplate;
  50.     pTemplate = new CSingleDocTemplate(
  51.         IDR_MAINFRAME,
  52.         RUNTIME_CLASS(CCheckBookDoc),
  53.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  54.         RUNTIME_CLASS(CCheckBookView));
  55.     AddDocTemplate(pTemplate);
  56.  
  57.     OnFileNew();
  58.  
  59.     return TRUE;
  60. }
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CAboutDlg dialog used for App About
  64.  
  65. class CAboutDlg : public CDialog
  66. {
  67. public:
  68.     CAboutDlg();
  69.  
  70. // Dialog Data
  71.     //{{AFX_DATA(CAboutDlg)
  72.     enum { IDD = IDD_ABOUTBOX };
  73.     //}}AFX_DATA
  74.  
  75.     // ClassWizard generated virtual function overrides
  76.     //{{AFX_VIRTUAL(CAboutDlg)
  77.     protected:
  78.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  79.     //}}AFX_VIRTUAL
  80.  
  81. // Implementation
  82. protected:
  83.     //{{AFX_MSG(CAboutDlg)
  84.     virtual BOOL OnInitDialog();
  85.     //}}AFX_MSG
  86.  
  87.     DECLARE_MESSAGE_MAP()
  88. };
  89.  
  90. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  91. {
  92.     //{{AFX_DATA_INIT(CAboutDlg)
  93.     //}}AFX_DATA_INIT
  94. }
  95.  
  96. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  97. {
  98.     CDialog::DoDataExchange(pDX);
  99.     //{{AFX_DATA_MAP(CAboutDlg)
  100.     //}}AFX_DATA_MAP
  101. }
  102.  
  103. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  104.     //{{AFX_MSG_MAP(CAboutDlg)
  105.         // No message handlers
  106.     //}}AFX_MSG_MAP
  107. END_MESSAGE_MAP()
  108.  
  109. /////////////////////////////////////////////////////////////////////////////
  110. // CAboutDlg message handlers
  111.  
  112. BOOL CAboutDlg::OnInitDialog() 
  113. {
  114.     CDialog::OnInitDialog();
  115.     CenterWindow();    
  116.     return TRUE;
  117. }
  118.  
  119. // App command to run the dialog
  120. void CCheckBookApp::OnAppAbout()
  121. {
  122.     CAboutDlg aboutDlg;
  123.     aboutDlg.DoModal();
  124. }
  125.  
  126. /////////////////////////////////////////////////////////////////////////////
  127. // CCheckBookApp commands
  128.  
  129. void CCheckBookApp::OnAppExit() 
  130. {
  131.     CWinApp::OnAppExit();
  132. }
  133.  
  134. void CCheckBookApp::OnFileOpen() 
  135. {
  136.     CWinApp::OnFileNew();
  137. }
  138.