00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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