home *** CD-ROM | disk | FTP | other *** search
- // my3dview.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "my3d.h"
- #include "my3dview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMy3dView
-
- IMPLEMENT_DYNCREATE(CMy3dView, CFormView)
-
- CMy3dView::CMy3dView()
- : CFormView(CMy3dView::IDD)
- {
- //{{AFX_DATA_INIT(CMy3dView)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- char FileToOpen[255];
-
-
- // Open the 8Reagan WAV session
- strcpy ( FileToOpen, "\\vcProg\\WAV\\8Reagan.WAV" );
- m_ReaganSession = sp_OpenSession ( FileToOpen );
-
-
- // If WAV session cannot be opened, display message box.
- if ( m_ReaganSession < 0 )
- {
- CString Message, Caption;
- Message = "Can't open the file: ";
- Message = Message + FileToOpen;
- Caption = "Error";
- MessageBox ( Message, Caption );
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- CMy3dView::~CMy3dView()
- {
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- sp_CloseSession ( m_ReaganSession );
-
- ////////////////////,
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMy3dView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMy3dView)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CMy3dView, CFormView)
- //{{AFX_MSG_MAP(CMy3dView)
- ON_VBXEVENT(VBN_CLICK, IDC_COMMAND3D1, OnClickCommand3d1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMy3dView message handlers
-
-
- void CMy3dView::OnClickCommand3d1(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Play the Reagan speech
- sp_PlaySnd ( m_ReaganSession,
- SP_START_OF_FILE,
- SP_END_OF_FILE);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
- }
-