home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfHex / VfHex.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  4.5 KB  |  161 lines

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5.  
  6. // VfHex.cpp : Defines the class behaviors for the application.
  7. //
  8. #include "stdafx.h"
  9. #include "VfHex.h"
  10.  
  11. #include "MainFrm.h"
  12. #include "VfHexDoc.h"
  13. #include "VfHexView.h"
  14. // #include "VForm.h"
  15.  
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CVfHexApp
  24.  
  25. BEGIN_MESSAGE_MAP(CVfHexApp, CWinApp)
  26.     //{{AFX_MSG_MAP(CVfHexApp)
  27.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG_MAP
  31.     // Standard file based document commands
  32.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  33.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  34.     // Standard print setup command
  35.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  36. END_MESSAGE_MAP()
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CVfHexApp construction
  40.  
  41. CVfHexApp::CVfHexApp()
  42. {
  43.     // TODO: add construction code here,
  44.     // Place all significant initialization in InitInstance
  45. }
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // The one and only CVfHexApp object
  49.  
  50. CVfHexApp theApp;
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CVfHexApp initialization
  54.  
  55. BOOL CVfHexApp::InitInstance()
  56. {
  57.     // Standard initialization
  58.     // If you are not using these features and wish to reduce the size
  59.     //  of your final executable, you should remove from the following
  60.     //  the specific initialization routines you do not need.
  61.  
  62.     // Note: the registrar is not needed, since we are calling VForm::Create()
  63.     // VFormRegistrar myRegistrar;    // Constructor registers VForm window class
  64.  
  65. #ifdef _AFXDLL
  66.     Enable3dControls();            // Call this when using MFC in a shared DLL
  67. #else
  68.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  69. #endif
  70.  
  71.     // Change the registry key under which our settings are stored.
  72.     // You should modify this string to be something appropriate
  73.     // such as the name of your company or organization.
  74.     SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  75.  
  76.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  77.  
  78.     // Register the application's document templates.  Document templates
  79.     //  serve as the connection between documents, frame windows and views.
  80.  
  81.     CSingleDocTemplate* pDocTemplate;
  82.     pDocTemplate = new CSingleDocTemplate(
  83.         IDR_MAINFRAME,
  84.         RUNTIME_CLASS(CVfHexDoc),
  85.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  86.         RUNTIME_CLASS(CVfHexView));
  87.     AddDocTemplate(pDocTemplate);
  88.  
  89.     // Parse command line for standard shell commands, DDE, file open
  90.     CCommandLineInfo cmdInfo;
  91.     ParseCommandLine(cmdInfo);
  92.  
  93.     // Dispatch commands specified on the command line
  94.     if (!ProcessShellCommand(cmdInfo))
  95.         return FALSE;
  96.  
  97.     // The one and only window has been initialized, so show and update it.
  98.     m_pMainWnd->ShowWindow(SW_SHOW);
  99.     m_pMainWnd->UpdateWindow();
  100.  
  101.     OnAppAbout();                // Display about box
  102.  
  103.     return TRUE;
  104. }
  105.  
  106. /////////////////////////////////////////////////////////////////////////////
  107. // CAboutDlg dialog used for App About
  108.  
  109. class CAboutDlg : public CDialog
  110. {
  111. public:
  112.     CAboutDlg();
  113.  
  114. // Dialog Data
  115.     //{{AFX_DATA(CAboutDlg)
  116.     enum { IDD = IDD_ABOUTBOX };
  117.     //}}AFX_DATA
  118.  
  119.     // ClassWizard generated virtual function overrides
  120.     //{{AFX_VIRTUAL(CAboutDlg)
  121.     protected:
  122.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  123.     //}}AFX_VIRTUAL
  124.  
  125. // Implementation
  126. protected:
  127.     //{{AFX_MSG(CAboutDlg)
  128.         // No message handlers
  129.     //}}AFX_MSG
  130.     DECLARE_MESSAGE_MAP()
  131. };
  132.  
  133. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  134. {
  135.     //{{AFX_DATA_INIT(CAboutDlg)
  136.     //}}AFX_DATA_INIT
  137. }
  138.  
  139. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  140. {
  141.     CDialog::DoDataExchange(pDX);
  142.     //{{AFX_DATA_MAP(CAboutDlg)
  143.     //}}AFX_DATA_MAP
  144. }
  145.  
  146. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  147.     //{{AFX_MSG_MAP(CAboutDlg)
  148.         // No message handlers
  149.     //}}AFX_MSG_MAP
  150. END_MESSAGE_MAP()
  151.  
  152. // App command to run the dialog
  153. void CVfHexApp::OnAppAbout()
  154. {
  155.     CAboutDlg aboutDlg;
  156.     aboutDlg.DoModal();
  157. }
  158.  
  159. /////////////////////////////////////////////////////////////////////////////
  160. // CVfHexApp commands
  161.