home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // hotspot.cpp : Implementation of the CHotspotApp class
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // (C) Copyright Black Diamond Consulting, Inc 1996. All rights reserved.
- //
- // You have a royalty-free right to use, modify, reproduce and
- // distribute the Sample Files (and/or any modified version) in
- // any way you find useful, provided that you agree that Black
- // Diamond Consulting has no warranty obligations or liability
- // for any Sample Application Files which are modified.
- //
- // Revision History:
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #include "stdafx.h"
- #include <initguid.h>
- #include "Surround.h"
-
- #ifndef __HOTSPOT_H__
- #include "hotspot.h"
- #endif
-
- #ifndef __MAINFRM_H__
- #include "mainfrm.h"
- #endif
-
- #ifndef __SVDOC_H__
- #include "SVDoc.h"
- #endif
-
- #ifndef __SVVIEW_H__
- #include "SVView.h"
- #endif
-
- #ifndef __ABOUTBOX_H__
- #include "AboutBox.h"
- #endif
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspotApp
-
- BEGIN_MESSAGE_MAP(CHotspotApp, CWinApp)
- //{{AFX_MSG_MAP(CHotspotApp)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- //}}AFX_MSG_MAP
- // Standard file based document commands
- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
- ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
- // Standard print setup command
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CHotspotApp object
-
- CHotspotApp theApp;
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspotApp construction
-
- CHotspotApp::CHotspotApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspotApp initialization
-
- BOOL CHotspotApp::InitInstance()
- {
- // Initialize OLE libraries
- if (!AfxOleInit())
- {
- AfxMessageBox(IDP_OLE_INIT_FAILED);
- return FALSE;
- }
-
- LoadStdProfileSettings(); // Load standard INI file options (including MRU)
-
- // Register the application's document template. Document templates
- // serve as the connection between documents, frame windows and views.
- AddDocTemplate(new CSingleDocTemplate( IDR_MAINFRAME,
- RUNTIME_CLASS(CSVViewerDoc),
- RUNTIME_CLASS(CMainFrame),
- RUNTIME_CLASS(CSVViewerView)));
-
- // create a new (empty) document
- OnFileNew();
-
- if (m_lpCmdLine[0] != '\0')
- {
- OpenDocumentFile( m_lpCmdLine );
- }
-
- return TRUE;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspotApp commands
-
- void CHotspotApp::OnFileOpen()
- {
- CString newName;
-
- // Put up a File dialog to get user's file choice, if he makes one...
- CFileDialog cDlg( TRUE,
- NULL,
- "*.svi",
- OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,
- "Surround Video Image Files (*.svi)||",
- NULL );
-
- cDlg.m_ofn.lpstrTitle = "Open";
-
- if( cDlg.DoModal() != IDOK )
- return;
-
- newName = cDlg.GetPathName();
-
- OpenDocumentFile(newName);
- }
-
-
- // App command to run the dialog
- void CHotspotApp::OnAppAbout()
- {
- CAboutBox aboutDlg;
- aboutDlg.DoModal();
- }
-
-