OSDN Git Service

2011/11/10 22:03:23
[nlite/nlite.git] / nlite / nlite.cpp
1 // nlite.cpp : \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\83G\83\93\83g\83\8a \83|\83C\83\93\83g\82ð\92è\8b`\82µ\82Ü\82·\81B
2 //
3
4 #include "stdafx.h"
5 #include "nlite_include.h"
6 using namespace nlite;
7
8 CAppModule _Module;
9
10 const nlite::CApplicationInfo* appInfo = NULL;
11
12
13
14
15 static BOOL InitializeNlite();                                  //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»
16 static VOID FinalizeNlite();                                    //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\8f\88\97\9d
17 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
18         LPTSTR lpCmdLine, int nCmdShow)
19 {
20    
21         int nRet = -1;
22         try{
23                 if(_Module.Init(NULL, hInstance) != S_OK){
24                         throw AppInitException();
25                 }
26                         
27                 InitializeNlite();
28                 
29
30                 
31                 CMessageLoop theLoop;
32                 _Module.AddMessageLoop(&theLoop);
33
34                 // \93Æ\8e©\83E\83B\83\93\83h\83E\82ð\8dì\90¬
35                 CNliteMainFrame wnd;
36                 wnd.CreateEx();
37                 wnd.ShowWindow(nCmdShow);
38                 wnd.UpdateWindow();
39
40                 nRet = theLoop.Run();
41
42                 _Module.RemoveMessageLoop();
43         } catch(std::exception e){
44
45                 MessageBoxA(NULL,e.what(),"\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83G\83\89\81[",MB_OK);
46         }
47
48         FinalizeNlite();
49         _Module.Term();
50
51         return nRet;
52 }
53
54 static BOOL InitializeNlite(){
55
56         BOOL rslt = FALSE;
57
58         try{
59
60                 appInfo = &CApplicationInfo::getInstance();
61                 
62
63         }catch (AppInitException e){
64
65                 return rslt;
66
67         }
68
69         rslt = TRUE;
70
71
72         return rslt;
73 }
74
75
76  VOID FinalizeNlite(){
77
78
79
80          return;
81  }