home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 15: Shareware / PC Actual CDT 15.iso / files / Windows_95_98 / Programacion / ActiveX / NCTWavPlayer.exe / Main / TestVC.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-06  |  4.1 KB  |  156 lines

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