Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: GASPilot/GASPilot_Main.cpp Source File

GASPilot_Main.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 /// \file GASPilot_Main.cpp
00003 /// \brief Windows MAIN for GASPilot
00004 /// \ingroup CAT
00005 /// 
00006 /// Copyright (c) 2003-2008 by Michael Ellison.
00007 /// See COPYING.txt for the \ref gaslicense License (MIT License).
00008 ///
00009 // $Author: mikeellison $
00010 // $Date: 2008-01-21 08:33:12 -0600 (Mon, 21 Jan 2008) $
00011 // $Revision:   $
00012 // $NoKeywords: $
00013 //---------------------------------------------------------------------------
00014 
00015 #include "CATString.h"
00016 #include "GASPilot.h"
00017 
00018 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
00019 {
00020    if (FAILED(::CoInitialize(0)))
00021    {
00022       ::MessageBox(NULL,L"Could not initialize COM.\n",L"GASPilot",MB_OK);
00023       return -1;
00024    }
00025 
00026    CATResult result = CAT_SUCCESS;
00027    try
00028    {
00029       gApp = new GASPilot(hInstance, CAT_GUI,L"GASPilot");
00030    }
00031    catch(...)
00032    {
00033       gApp = 0;
00034    }
00035 
00036    if (gApp == 0)
00037    {
00038       ::MessageBox(NULL,L"Could not create app object. Terminating.",L"SkeletonApp",MB_OK);
00039       ::CoUninitialize();
00040       return -1;
00041    }
00042    
00043    if (CATFAILED(result))
00044    {
00045       gApp->DisplayError(result);
00046       ::CoUninitialize();
00047       return result;
00048    }
00049 
00050    result = gApp->Run();
00051    
00052    if (CATFAILED(result))
00053    {
00054       gApp->DisplayError(result);
00055    }
00056    
00057    delete gApp;
00058    gApp = 0;
00059 
00060    ::CoUninitialize();
00061    return result;
00062 }
00063 

Generated on Mon Feb 11 04:09:59 2008 for Game Accessibility Suite by doxygen 1.5.4