![]() |
Change language - SetResourceHandle |
Post Reply ![]() |
Author | |
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() Posted: 10 July 2012 at 11:42am |
Hi Oleg,
I want to change the language at run time. I get an exception, if I use the followed code: HMODULE hModule = ::LoadLibrary( "c:\\Program Files\\Codejock Software\\MFC\\Xtreme ToolkitPro v15.1.3.0908\\Utils\\Translations\\ToolkitPro.ResourceDe.dll"); USHORT LangID = LANG_GERMAN; XTPResourceManager()->SetResourceHandle(hModule); ::SetThreadLocale(MAKELCID(MAKELANGID(LangID,SUBLANG_DEFAULT), SORT_DEFAULT)); CXTPTaskDialog dlg; dlg.SetWindowTitle("Test"); dlg.SetMainInstruction("Test..."); dlg.SetContent("Info"); dlg.SetCommonButtons(TDCBF_YES_BUTTON | TDCBF_NO_BUTTON); dlg.EnableCancellation(TRUE); // the followed line causes an exception in CXTPTaskDialogClient::CreateIcon by calling dlg.DoModal(), because LoadSysIcon(lpwzIcon, sizeIcon) returned NULL => ASSERT(hNewIcon != NULL); dlg.SetMainIcon((LPCWSTR)TD_INFORMATION_ICON); dlg.DoModal(); Why does this happened? Best regards Fabian
|
|
![]() |
|
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() |
By clicking 'ignore' on exception the correct dialog (buttontext has german language) appear, but without info-icon!
|
|
![]() |
|
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() |
Hi, no idea?
|
|
![]() |
|
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I find the solution. If we set the Resourcehandle by calling SetResourceHandle, we have to call SetUseSysIcons(TRUE), too. Then, the Icon will loaded successfully! |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |