MOOS 0.2375
|
00001 00002 // 00003 // MOOS - Mission Oriented Operating Suite 00004 // 00005 // A suit of Applications and Libraries for Mobile Robotics Research 00006 // Copyright (C) 2001-2005 Massachusetts Institute of Technology and 00007 // Oxford University. 00008 // 00009 // This software was written by Paul Newman at MIT 2001-2002 and Oxford 00010 // University 2003-2005. email: pnewman@robots.ox.ac.uk. 00011 // 00012 // This file is part of a MOOS Utility Component. 00013 // 00014 // This program is free software; you can redistribute it and/or 00015 // modify it under the terms of the GNU General Public License as 00016 // published by the Free Software Foundation; either version 2 of the 00017 // License, or (at your option) any later version. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 // General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00030 // uPlayBack.cpp : Defines the class behaviors for the application. 00031 // 00032 00033 #include "stdafx.h" 00034 #include "uPlayBack.h" 00035 #include "uPlayBackDlg.h" 00036 //#include <initguid.h> 00037 #include "Splash.h" 00038 #ifdef _DEBUG 00039 #define new DEBUG_NEW 00040 #undef THIS_FILE 00041 static char THIS_FILE[] = __FILE__; 00042 #endif 00043 00045 // CUPlayBackApp 00046 00047 BEGIN_MESSAGE_MAP(CUPlayBackApp, CWinApp) 00048 //{{AFX_MSG_MAP(CUPlayBackApp) 00049 // NOTE - the ClassWizard will add and remove mapping macros here. 00050 // DO NOT EDIT what you see in these blocks of generated code! 00051 //}}AFX_MSG 00052 ON_COMMAND(ID_HELP, CWinApp::OnHelp) 00053 END_MESSAGE_MAP() 00054 00056 // CUPlayBackApp construction 00057 00058 CUPlayBackApp::CUPlayBackApp() 00059 { 00060 // TODO: add construction code here, 00061 // Place all significant initialization in InitInstance 00062 } 00063 00065 // The one and only CUPlayBackApp object 00066 00067 CUPlayBackApp theApp; 00068 00070 // CUPlayBackApp initialization 00071 00072 BOOL CUPlayBackApp::InitInstance() 00073 { 00074 00075 AfxEnableControlContainer(); 00076 00077 CCommandLineInfo cmdInfo; 00078 ParseCommandLine(cmdInfo); 00079 00080 CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash); 00081 00082 00083 if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) 00084 { 00085 return TRUE; 00086 } 00087 00088 00089 00090 // Standard initialization 00091 // If you are not using these features and wish to reduce the size 00092 // of your final executable, you should remove from the following 00093 // the specific initialization routines you do not need. 00094 00095 #ifdef _AFXDLL 00096 Enable3dControls(); // Call this when using MFC in a shared DLL 00097 #else 00098 Enable3dControlsStatic(); // Call this when linking to MFC statically 00099 #endif 00100 00101 CUPlayBackDlg dlg; 00102 m_pMainWnd = &dlg; 00103 int nResponse = dlg.DoModal(); 00104 if (nResponse == IDOK) 00105 { 00106 // TODO: Place code here to handle when the dialog is 00107 // dismissed with OK 00108 } 00109 else if (nResponse == IDCANCEL) 00110 { 00111 // TODO: Place code here to handle when the dialog is 00112 // dismissed with Cancel 00113 } 00114 00115 // Since the dialog has been closed, return FALSE so that we exit the 00116 // application, rather than start the application's message pump. 00117 return FALSE; 00118 } 00119 00120 00121 CUPlayBackModule _Module; 00122 00123 BEGIN_OBJECT_MAP(ObjectMap) 00124 END_OBJECT_MAP() 00125 00126 LONG CUPlayBackModule::Unlock() 00127 { 00128 AfxOleUnlockApp(); 00129 return 0; 00130 } 00131 00132 LONG CUPlayBackModule::Lock() 00133 { 00134 AfxOleLockApp(); 00135 return 1; 00136 } 00137 LPCTSTR CUPlayBackModule::FindOneOf(LPCTSTR p1, LPCTSTR p2) 00138 { 00139 while (*p1 != NULL) 00140 { 00141 LPCTSTR p = p2; 00142 while (*p != NULL) 00143 { 00144 if (*p1 == *p) 00145 return CharNext(p1); 00146 p = CharNext(p); 00147 } 00148 p1++; 00149 } 00150 return NULL; 00151 } 00152 00153 00154 int CUPlayBackApp::ExitInstance() 00155 { 00156 00157 return CWinApp::ExitInstance(); 00158 00159 } 00160