home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch32 / flags / flagsvw.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  8.6 KB  |  370 lines

  1. // flagsvw.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "flags.h"
  6. #include "flagsvw.h"
  7.  
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CFlagsView
  15.  
  16. IMPLEMENT_DYNCREATE(CFlagsView, CFormView)
  17.  
  18. CFlagsView::CFlagsView()
  19.     : CFormView(CFlagsView::IDD)
  20. {
  21.     //{{AFX_DATA_INIT(CFlagsView)
  22.     m_midi = NULL;
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26. CFlagsView::~CFlagsView()
  27. {
  28. }
  29.  
  30. void CFlagsView::DoDataExchange(CDataExchange* pDX)
  31. {
  32.     CFormView::DoDataExchange(pDX);
  33.     //{{AFX_DATA_MAP(CFlagsView)
  34.     DDX_VBControl(pDX, IDC_TEGOMM1, m_midi);
  35.     //}}AFX_DATA_MAP
  36. }
  37.  
  38.  
  39. BEGIN_MESSAGE_MAP(CFlagsView, CFormView)
  40.     //{{AFX_MSG_MAP(CFlagsView)
  41.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_USA, OnClickCommand3dUsa)
  42.     ON_BN_CLICKED(IDC_STOP_BUTTON, OnStopButton)
  43.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_ISRAEL, OnClickCommand3dIsrael)
  44.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_ENGLAND, OnClickCommand3dEngland)
  45.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_FRANCE, OnClickCommand3dFrance)
  46.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_JAPAN, OnClickCommand3dJapan)
  47.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_CANADA, OnClickCommand3dCanada)
  48.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_MEXICO, OnClickCommand3dMexico)
  49.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_NETHERLANDS, OnClickCommand3dNetherlands)
  50.     ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D_CHINA, OnClickCommand3dChina)
  51.     //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53.  
  54.  
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CFlagsView message handlers
  57.  
  58.  
  59. void CFlagsView::OnClickCommand3dUsa(UINT, int, CWnd*, LPVOID)
  60. {
  61.     // TODO: Add your VBX event notification handler code here
  62.     
  63.      //////////////////////
  64.      // MY CODE STARTS HERE
  65.      //////////////////////
  66.  
  67.      // Close the MIDI device
  68.     m_midi->SetStrProperty("Command", "Close");
  69.  
  70.     // Set the name of the MIDI file
  71.     m_midi->SetStrProperty("FileName",
  72.                       "\\VCPROG\\MIDI\\ANTHEMS\\USA.MID" );
  73.     // Open the MIDI file
  74.     m_midi->SetStrProperty("Command", "Open");
  75.  
  76.     // Rewind the MIDI file
  77.     m_midi->SetStrProperty("Command", "Prev");
  78.  
  79.     // Play the MIDI file
  80.     m_midi->SetStrProperty("Command", "Play");
  81.  
  82.      ////////////////////
  83.      // MY CODE ENDS HERE
  84.      ////////////////////
  85.  
  86.  
  87. }
  88.  
  89. void CFlagsView::OnStopButton()
  90. {
  91.     // TODO: Add your control notification handler code here
  92.     
  93.     //////////////////////
  94.     // MY CODE STARTS HERE
  95.     //////////////////////
  96.  
  97.     // Stop the playback
  98.     m_midi->SetStrProperty("Command", "Stop");
  99.  
  100.     ////////////////////
  101.     // MY CODE ENDS HERE
  102.     ////////////////////
  103.  
  104. }
  105.  
  106. void CFlagsView::OnClickCommand3dIsrael(UINT, int, CWnd*, LPVOID)
  107. {
  108.     // TODO: Add your VBX event notification handler code here
  109.  
  110.      //////////////////////
  111.      // MY CODE STARTS HERE
  112.      //////////////////////
  113.  
  114.      // Close the MIDI device
  115.     m_midi->SetStrProperty("Command", "Close");
  116.  
  117.     // Set the name of the MIDI file
  118.     m_midi->SetStrProperty("FileName",
  119.            "\\VCPROG\\MIDI\\ANTHEMS\\ISRAEL.MID" );
  120.  
  121.     // Open the MIDI file
  122.     m_midi->SetStrProperty("Command", "Open");
  123.  
  124.     // Rewind the MIDI file
  125.     m_midi->SetStrProperty("Command", "Prev");
  126.  
  127.  
  128.     // Play the MIDI file
  129.     m_midi->SetStrProperty("Command", "Play");
  130.  
  131.  
  132.      ////////////////////
  133.      // MY CODE ENDS HERE
  134.      ////////////////////
  135.     
  136. }
  137.  
  138. void CFlagsView::OnClickCommand3dEngland(UINT, int, CWnd*, LPVOID)
  139. {
  140.     // TODO: Add your VBX event notification handler code here
  141.     
  142.      //////////////////////
  143.      // MY CODE STARTS HERE
  144.      //////////////////////
  145.  
  146.    // Close the MIDI device
  147.     m_midi->SetStrProperty("Command", "Close");
  148.  
  149.  
  150.     // Set the name of the MIDI file
  151.     m_midi->SetStrProperty("FileName",
  152.                    "\\VCPROG\\MIDI\\ANTHEMS\\ENGLAND.MID" );
  153.  
  154.     // Open the MIDI file
  155.     m_midi->SetStrProperty("Command", "Open");
  156.  
  157.     // Rewind the MIDI file
  158.     m_midi->SetStrProperty("Command", "Prev");
  159.  
  160.  
  161.     // Play the MIDI file
  162.     m_midi->SetStrProperty("Command", "Play");
  163.  
  164.  
  165.      ////////////////////
  166.      // MY CODE ENDS HERE
  167.      ////////////////////
  168. }
  169.  
  170. void CFlagsView::OnClickCommand3dFrance(UINT, int, CWnd*, LPVOID)
  171. {
  172. // TODO: Add your VBX event notification handler code here
  173.  
  174.      //////////////////////
  175.      // MY CODE STARTS HERE
  176.      //////////////////////
  177.  
  178.     // Close the MIDI device
  179.     m_midi->SetStrProperty("Command", "Close");
  180.  
  181.  
  182.     // Set the name of the MIDI file
  183.     m_midi->SetStrProperty("FileName",
  184.                   "\\VCPROG\\MIDI\\ANTHEMS\\FRANCE.MID" );
  185.  
  186.     // Open the MIDI file
  187.     m_midi->SetStrProperty("Command", "Open");
  188.  
  189.     // Rewind the MIDI file
  190.     m_midi->SetStrProperty("Command", "Prev");
  191.  
  192.  
  193.     // Play the MIDI file
  194.     m_midi->SetStrProperty("Command", "Play");
  195.  
  196.  
  197.     ////////////////////
  198.     // MY CODE ENDS HERE
  199.     ////////////////////
  200. }
  201.  
  202. void CFlagsView::OnClickCommand3dJapan(UINT, int, CWnd*, LPVOID)
  203. {
  204.     // TODO: Add your VBX event notification handler code here
  205.  
  206.     //////////////////////
  207.     // MY CODE STARTS HERE
  208.     //////////////////////
  209.  
  210.     // Close the MIDI device
  211.     m_midi->SetStrProperty("Command", "Close");
  212.  
  213.  
  214.     // Set the name of the MIDI file
  215.     m_midi->SetStrProperty("FileName",
  216.                   "\\VCPROG\\MIDI\\ANTHEMS\\JAPAN.MID" );
  217.  
  218.     // Open the MIDI file
  219.     m_midi->SetStrProperty("Command", "Open");
  220.  
  221.     // Rewind the MIDI file
  222.     m_midi->SetStrProperty("Command", "Prev");
  223.  
  224.  
  225.     // Play the MIDI file
  226.     m_midi->SetStrProperty("Command", "Play");
  227.  
  228.  
  229.     ////////////////////
  230.     // MY CODE ENDS HERE
  231.     ////////////////////
  232.  
  233.     
  234. }
  235.  
  236. void CFlagsView::OnClickCommand3dCanada(UINT, int, CWnd*, LPVOID)
  237. {
  238.     // TODO: Add your VBX event notification handler code here
  239.     
  240.     //////////////////////
  241.     // MY CODE STARTS HERE
  242.     //////////////////////
  243.  
  244.    // Close the MIDI device
  245.     m_midi->SetStrProperty("Command", "Close");
  246.  
  247.  
  248.     // Set the name of the MIDI file
  249.     m_midi->SetStrProperty("FileName",
  250.                  "\\VCPROG\\MIDI\\ANTHEMS\\CANADA.MID" );
  251.  
  252.     // Open the MIDI file
  253.     m_midi->SetStrProperty("Command", "Open");
  254.  
  255.     // Rewind the MIDI file
  256.     m_midi->SetStrProperty("Command", "Prev");
  257.  
  258.  
  259.     // Play the MIDI file
  260.     m_midi->SetStrProperty("Command", "Play");
  261.  
  262.  
  263.     ////////////////////
  264.     // MY CODE ENDS HERE
  265.     ////////////////////
  266.  
  267.  
  268.  
  269. }
  270.  
  271. void CFlagsView::OnClickCommand3dMexico(UINT, int, CWnd*, LPVOID)
  272. {
  273. // TODO: Add your VBX event notification handler code here
  274.  
  275.     //////////////////////
  276.     // MY CODE STARTS HERE
  277.     //////////////////////
  278.  
  279.     // Close the MIDI device
  280.     m_midi->SetStrProperty("Command", "Close");
  281.  
  282.  
  283.     // Set the name of the MIDI file
  284.     m_midi->SetStrProperty("FileName",
  285.                  "\\VCPROG\\MIDI\\ANTHEMS\\MEXICO.MID" );
  286.  
  287.     // Open the MIDI file
  288.     m_midi->SetStrProperty("Command", "Open");
  289.  
  290.     // Rewind the MIDI file
  291.     m_midi->SetStrProperty("Command", "Prev");
  292.  
  293.  
  294.     // Play the MIDI file
  295.     m_midi->SetStrProperty("Command", "Play");
  296.  
  297.  
  298.     ////////////////////
  299.     // MY CODE ENDS HERE
  300.     ////////////////////
  301.  
  302.     
  303. }
  304.  
  305. void CFlagsView::OnClickCommand3dNetherlands(UINT, int, CWnd*, LPVOID)
  306. {
  307.     // TODO: Add your VBX event notification handler code here
  308.     
  309.      //////////////////////
  310.      // MY CODE STARTS HERE
  311.      //////////////////////
  312.  
  313.     // Close the MIDI device
  314.     m_midi->SetStrProperty("Command", "Close");
  315.  
  316.  
  317.     // Set the name of the MIDI file
  318.     m_midi->SetStrProperty("FileName",
  319.                  "\\VCPROG\\MIDI\\ANTHEMS\\NETHERLA.MID" );
  320.  
  321.     // Open the MIDI file
  322.     m_midi->SetStrProperty("Command", "Open");
  323.  
  324.     // Rewind the MIDI file
  325.     m_midi->SetStrProperty("Command", "Prev");
  326.  
  327.  
  328.     // Play the MIDI file
  329.     m_midi->SetStrProperty("Command", "Play");
  330.  
  331.  
  332.     ////////////////////
  333.     // MY CODE ENDS HERE
  334.     ////////////////////
  335.  
  336. }
  337.  
  338. void CFlagsView::OnClickCommand3dChina(UINT, int, CWnd*, LPVOID)
  339. {
  340. // TODO: Add your VBX event notification handler code here
  341.  
  342.     //////////////////////
  343.     // MY CODE STARTS HERE
  344.     //////////////////////
  345.  
  346.     // Close the MIDI device
  347.     m_midi->SetStrProperty("Command", "Close");
  348.  
  349.  
  350.     // Set the name of the MIDI file
  351.     m_midi->SetStrProperty("FileName",
  352.                  "\\VCPROG\\MIDI\\ANTHEMS\\CHINA.MID" );
  353.  
  354.     // Open the MIDI file
  355.     m_midi->SetStrProperty("Command", "Open");
  356.  
  357.     // Rewind the MIDI file
  358.     m_midi->SetStrProperty("Command", "Prev");
  359.  
  360.  
  361.     // Play the MIDI file
  362.     m_midi->SetStrProperty("Command", "Play");
  363.  
  364.  
  365.      ////////////////////
  366.      // MY CODE ENDS HERE
  367.      ////////////////////
  368.     
  369. }
  370.