home *** CD-ROM | disk | FTP | other *** search
/ Looney Tunes Photo Fun / LooneyTunesPhotoFun.iso / Daosdk / DISK4 / DAOSDK.1 / multthrd.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-06  |  3.6 KB  |  143 lines

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