home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / LTCDB.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-10  |  3.5 KB  |  140 lines

  1. // ltcdb.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "ltcdb.h"
  6.  
  7. #include "MainFrm.h"
  8. #include "ltcdbSet.h"
  9. #include "ltcdbDoc.h"
  10. #include "ocdbView.h"
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CLtcdbApp
  20.  
  21. BEGIN_MESSAGE_MAP(CLtcdbApp, CWinApp)
  22.     //{{AFX_MSG_MAP(CLtcdbApp)
  23.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  24.         // NOTE - the ClassWizard will add and remove mapping macros here.
  25.         //    DO NOT EDIT what you see in these blocks of generated code!
  26.     //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CLtcdbApp construction
  31.  
  32. CLtcdbApp::CLtcdbApp()
  33. {
  34.     // TODO: add construction code here,
  35.     // Place all significant initialization in InitInstance
  36. }
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // The one and only CLtcdbApp object
  40.  
  41. CLtcdbApp theApp;
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CLtcdbApp initialization
  45.  
  46. BOOL CLtcdbApp::InitInstance()
  47. {
  48.     AfxEnableControlContainer();
  49.  
  50.     // Standard initialization
  51.     // If you are not using these features and wish to reduce the size
  52.     //  of your final executable, you should remove from the following
  53.     //  the specific initialization routines you do not need.
  54.  
  55. #ifdef _AFXDLL
  56.     Enable3dControls();            // Call this when using MFC in a shared DLL
  57. #else
  58.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  59. #endif
  60.  
  61.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  62.  
  63.     // Register the application's document templates.  Document templates
  64.     //  serve as the connection between documents, frame windows and views.
  65.  
  66.     CSingleDocTemplate* pDocTemplate;
  67.     pDocTemplate = new CSingleDocTemplate(
  68.         IDR_MAINFRAME,
  69.         RUNTIME_CLASS(CLtcdbDoc),
  70.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  71.         RUNTIME_CLASS(CLtcdbView));
  72.     AddDocTemplate(pDocTemplate);
  73.  
  74.     // Parse command line for standard shell commands, DDE, file open
  75.     CCommandLineInfo cmdInfo;
  76.     ParseCommandLine(cmdInfo);
  77.  
  78.     // Dispatch commands specified on the command line
  79.     if (!ProcessShellCommand(cmdInfo))
  80.         return FALSE;
  81.  
  82.     return TRUE;
  83. }
  84.  
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CAboutDlg dialog used for App About
  87.  
  88. class CAboutDlg : public CDialog
  89. {
  90. public:
  91.     CAboutDlg();
  92.  
  93. // Dialog Data
  94.     //{{AFX_DATA(CAboutDlg)
  95.     enum { IDD = IDD_ABOUTBOX };
  96.     //}}AFX_DATA
  97.  
  98.     // ClassWizard generated virtual function overrides
  99.     //{{AFX_VIRTUAL(CAboutDlg)
  100.     protected:
  101.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  102.     //}}AFX_VIRTUAL
  103.  
  104. // Implementation
  105. protected:
  106.     //{{AFX_MSG(CAboutDlg)
  107.         // No message handlers
  108.     //}}AFX_MSG
  109.     DECLARE_MESSAGE_MAP()
  110. };
  111.  
  112. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  113. {
  114.     //{{AFX_DATA_INIT(CAboutDlg)
  115.     //}}AFX_DATA_INIT
  116. }
  117.  
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120.     CDialog::DoDataExchange(pDX);
  121.     //{{AFX_DATA_MAP(CAboutDlg)
  122.     //}}AFX_DATA_MAP
  123. }
  124.  
  125. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  126.     //{{AFX_MSG_MAP(CAboutDlg)
  127.         // No message handlers
  128.     //}}AFX_MSG_MAP
  129. END_MESSAGE_MAP()
  130.  
  131. // App command to run the dialog
  132. void CLtcdbApp::OnAppAbout()
  133. {
  134.     CAboutDlg aboutDlg;
  135.     aboutDlg.DoModal();
  136. }
  137.  
  138. /////////////////////////////////////////////////////////////////////////////
  139. // CLtcdbApp commands
  140.