Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Change language - SetResourceHandle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change language - SetResourceHandle

 Post Reply Post Reply
Author
Message
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Topic: Change language - SetResourceHandle
    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
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2012 at 8:23am
By clicking 'ignore' on exception the correct dialog (buttontext has german language) appear, but without info-icon!
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 12 July 2012 at 10:09am
Hi, no idea?
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2012 at 4:52am
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!

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.