Support MultiLanguage in VC
-
I want my application which is written with VC to support Multiple language. i did the follow: first, i put resource to dlls, each dll is for one language, then, CMyApp::InitInstance() { int nLang = detect_which_language_to_use(); CString strLang; strLang.Format("Lang%d.dll", nLang); //load the resource HINSTANCE hInstance = ::LoadLibrary(LPCTSTR(strLang)); ASSERT(hInstance); ::AfxSetResourceHandle(hInstance); } it works. but now i want to let the user choose the language, that is, i add a menu in my program, user can choose the language he want by clicking the menu. how can i do these? thanks. hs
-
I want my application which is written with VC to support Multiple language. i did the follow: first, i put resource to dlls, each dll is for one language, then, CMyApp::InitInstance() { int nLang = detect_which_language_to_use(); CString strLang; strLang.Format("Lang%d.dll", nLang); //load the resource HINSTANCE hInstance = ::LoadLibrary(LPCTSTR(strLang)); ASSERT(hInstance); ::AfxSetResourceHandle(hInstance); } it works. but now i want to let the user choose the language, that is, i add a menu in my program, user can choose the language he want by clicking the menu. how can i do these? thanks. hs
Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-
-
Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-
-
i change the resource(AfxSetResourceHandle) by clicking a menu item, then i show new a dialog,my program use the dialog accord to my choice, but the GUIs which had been showed was not effected.
Hello, the codegurus around the world. ;) Actually, I don't understand your problem very well, but if I guess.... After the code passes the point of AfxSetResourceHandle, the application can't change the resouce DLL. (However, we may use FindResouce API function for each resouce ID..?) So, before AfxResourceHandle is called, we must choose which resouce DLL will be used. As a result, CMyDialog dlg (AfxGetMainWnd()); // for the bug of Windows ME. dlg.DoModal(); // with the radio button ? // Get the data which the user selects as the language from the dialog; if (sLang == EN)... HINSTANCE hInst = Loadlibrary (someDLL); if (hInst) AfxResourceHandle(hInst); ...... // After this, we can't change resouce DLL. Have a nice day! -Masaaki Onishi-
-
Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-
actually masaaki you could put a menu of bitmaps of flags to select the language you wanted as they do on many web sites :) --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
actually masaaki you could put a menu of bitmaps of flags to select the language you wanted as they do on many web sites :) --- "every year we invent better idiot proof systems and every year they invent better idiots"
Hello, the codegurus around the world. ;) lauren: I am already working for the other part of bitmaps for the international language. However, if we use the international language by bitmap format, we had better be careful about the appearance of this. For example, like the menu, 1) Japanese (normal letter on Dialog) - (Japanese) by bitmap. This bitmap had better have the same color of the background like the dialog as well as the same size of the font as the normal letter of dialog. As a result, we work more than we expect ....:( Have a nice day! -Masaaki Onishi-