• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            春暖花開
            雪化了,花開了,春天來了
            posts - 149,comments - 125,trackbacks - 0
            I have read several instruction, have looked at the MuiHello example (Smartphone SDK) and Googled, but to no help.
            To test, I create a Swedish resource dll/mui file with one resource item changed.

            I'm not really sure if the technique used in
            MuiHello can be appliced on MFC applications or not.

            I have named the out put file for my dll project to MyApp.exe.04d1.mui and placed it in the exe directory of the application.
            When I execute the application (MyApp.exe) in a Smartphone with user language set to Swedish, the swedish resource is not loaded.
            Originally I made resource-only dlls with no entry point but as the sample MuiHello has an entry point I have also tried to add this.

            I have also tried out the things found here, "Localized Resources in MFC Applications: Satellite DLLs"
            but with no success.
            I have tried out the following:
            • Named my resource-only dll to MyAppSVE.dll, place it in the same directory as the exe.
            • Extracting the English resources from the exe and placed them in a resource-only dll named, MyRes.dll. Renamed the resource-only Swedish resource dll to MyResSVE.dll. Used LoadLibrary("MyRes.dll") and AfxSetResourceHandle to set the resource instance.
            The result is the same, the Swedish resource is not loaded.

            If I explicitly load the Swedish resource dll and use AfxSetResourceHandle it works, but that is not just good enough.

            I have checked that the GetUserDefaultUILanguage() returns 0x04d1(Swedish)

            Been stuck with this for two days now and getting really frustrated.

            Does anyone know what I am doing wrong or how to do it in MFC?
            Any pointers and directions are appreciated.

            Cheers
            Martin

             

            Hi again,

            I'm still unable to get the correct resource dll to load.

            Instead I implemented the app so that it dynamically loaded the correct localized resoures.

            I implemeted it in a way so the I can choose to localize on Locale (sub language & primary language) or primary language.

             

            Code Block

            HINSTANCE g_hInst;

            HINSTANCE GetResHInstFormLangId(LANGID langId)

            {

            CString resDllName;

            resDllName.Format(_T("res%04x.dll"), langId);

            HINSTANCE hInst = LoadLibrary(resDllName);

            if(!hInst)

            {

            LANGID priLangId = PRIMARYLANGID(langId);

            resDllName.Format(_T("res%02x.dll"), priLangId);

            hInst = LoadLibrary(resDllName);

            }

            return hInst;

            }

             

            BOOL ClocalizedApp::InitInstance()

            {

            #if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)

            SHInitExtraControls();

            #endif // WIN32_PLATFORM_PSPC || WIN32_PLATFORM_WFSP

            SetRegistryKey(_T("Local AppWizard-Generated Applications"));

            //Home made localization support

            LANGID userLangId = GetUserDefaultUILanguage();

            g_hInst = GetResHInstFormLangId(userLangId);

            if(!g_hInst )

            {

            sysLangId = GetSystemDefaultUILanguage();

            if(userLandId != sysLangId)

            g_hInst = GetResHInstFormLangId(sysLangId);

            }

            if(g_hInst)

            AfxSetResourceHandle(g_hInst);

            ClocalizedDlg dlg;

            m_pMainWnd = &dlg;

            INT_PTR nResponse = dlg.DoModal();

            if (nResponse == IDOK)

            {

            }

            return FALSE;

            }

             

             

             

             

            The drawback is of cause the all resource must be included in all localized resource dlls.

            If anyone has the solution to the previous thread post please respond.

             

            /

            Martin

            Hi once again,

            Spent a too long time on this until I realized my misstake.
            Oh God such a simple one.

            In a application code created with the application wizard the virtual CWinApp::InitInstance is never called.
            If one have a look at the implementation of CWinApp::InitInstance, one can see that it is here where the loading of the resoure dlls are made.

            Simply put the localized dll in the same directory as the exe.
            If my exe is called myApp.exe, my resource dll for the swedish locale is myAppSVE.dll.
            In the InitInstance override function call CWinApp::InitInstance.

            As far as I can see CWinApp::InitInstance does not do anything but trying to load localized resources.

            Don't forget to call CWinApp::ExitInstance from any ExitInstance override, this frees the resource dll.
            (Oh no not again, I answered my own Question)
            Thanks Martin
            posted on 2008-11-19 09:58 Sandy 閱讀(565) 評論(0)  編輯 收藏 引用 所屬分類: Window Mobile
            青青草国产成人久久91网| 无码任你躁久久久久久老妇App| 亚洲国产另类久久久精品小说| 中文字幕久久久久人妻| 亚洲精品午夜国产VA久久成人| A狠狠久久蜜臀婷色中文网| 久久综合丁香激情久久| 久久精品国产一区二区三区不卡| 亚洲另类欧美综合久久图片区| 亚洲午夜久久久影院| 亚洲欧美日韩精品久久| 久久婷婷人人澡人人爽人人爱| 狠狠狠色丁香婷婷综合久久五月| 久久久久国产亚洲AV麻豆| 无码伊人66久久大杳蕉网站谷歌 | 精品久久久久中文字幕一区| 中文精品99久久国产 | 一本一道久久精品综合| 久久青青草原精品国产软件| 久久夜色精品国产噜噜麻豆| 久久久久国色AV免费观看| 精品久久久久久无码专区不卡| 久久久99精品成人片中文字幕| 国产精品免费福利久久| 狠狠色狠狠色综合久久| 亚洲国产日韩欧美综合久久| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久久久免费精品国产| 国产精品九九久久免费视频 | 99久久精品免费看国产免费| 伊人久久大香线蕉综合Av | 色综合久久久久网| 久久久久高潮毛片免费全部播放 | 亚洲国产精品一区二区久久hs| 国内精品久久久久伊人av| 久久99九九国产免费看小说| 亚洲国产精品婷婷久久| 91精品国产综合久久四虎久久无码一级| 久久综合亚洲欧美成人| 亚洲精品乱码久久久久66| 亚洲AV日韩精品久久久久久|