OSDN Git Service

NCVのリスナー情報同期処理
[nlite/nlite.git] / nlite / nlite.cpp
index 847d433..8872a48 100644 (file)
@@ -9,7 +9,7 @@ CAppModule _Module;
 
 
 
-static TCHAR localAppDataPath[_MAX_PATH];
+
 
 static WSAData wsaData;                                                        //winsockdata
 static HINTERNET hInternet = NULL;
@@ -29,12 +29,16 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
                //
                //\83A\83v\83\8a\83P\83P\81[\83V\83\87\83\93\8f\89\8aú\89»\8f\88\97\9d
                //
-
-               InitCommonControls();
-
-               if(_Module.Init(NULL, hInstance) != S_OK){
+               HRESULT hRes = ::CoInitialize(NULL);
+               ATLASSERT(SUCCEEDED(hRes));
+               //InitCommonControls();
+                AtlInitCommonControls(ICC_COOL_CLASSES | ICC_WIN95_CLASSES);
+                GUID guid;
+               if(_Module.Init(NULL, hInstance,&guid) != S_OK){
                        throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
+
+               AtlAxWinInit();
                        
                if(InitializeNlite() != TRUE){
                        throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
@@ -98,7 +102,7 @@ nliteend:
        _Module.RemoveMessageLoop();
        FinalizeNlite();
        _Module.Term();
-
+       ::CoUninitialize();
 
        return nRet;
 }
@@ -155,6 +159,10 @@ static BOOL InitializeNlite(){
                SystemParametersInfo (SPI_SETLISTBOXSMOOTHSCROLLING,FALSE,FALSE,0);
 
 
+               
+               SHGetFolderPathW(0,CSIDL_APPDATA,0,SHGFP_TYPE_CURRENT,appFolderPath);
+               ncvAppSettingPath = appFolderPath;
+               ncvAppSettingPath += TEXT("\\posite-c\\NiconamaCommentViewer\\AppSetting.xml");
        }catch (AppInitException e){
 
                return rslt;