![]() |
Language XML crash |
Post Reply
|
| Author | |
SMaton
Groupie
Joined: 04 May 2009 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: Language XML crashPosted: 04 May 2012 at 4:26am |
|
Hello everyone,
my application offers two languages: English and German. Upon application start the user can select one of those 2. To enable the language within Toolkit Pro, I do this: CString toolkitResources = ProgrammVerzeichnis() + "\\daten\\"; if ( !IstLaendereinstellungEnglisch()) { toolkitResources += "ToolkitPro.ResourceDe.xml"; } else { toolkitResources += "ToolkitPro.ResourceEn.xml"; } CXTPResourceManager::m_managerInstance->SetResourceFile(toolkitResources); if ( !IstLaendereinstellungEnglisch()) CXTPResourceManager::m_managerInstance.GetData()->SetResourceLanguage(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN)); else CXTPResourceManager::m_managerInstance.GetData()->SetResourceLanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK)); When adding new items to a property grid, the application crashes in random location within the memory. I debugged it down to this lines within the toolkit: CXTPPropertyGridItemBool::_Init(BOOL bValue) (line 76): if (XTPResourceManager()->LoadString(&strTrueFalse, XTP_IDS_PROPERTYGRID_TRUEFALSE) && (strTrueFalse.Find(_T('\n')) != -1)) I've digged through the documentation but I couldn't find any further information about the language handling and the SetResourceFile... I've also tried to load the language file like this: CXTPResourceManager::m_managerInstance->SetResourceManager(new CXTPResourceManagerXML(toolkitResources)); If I don't call "SetResourceFile" or "SetResourceManager" it doesn't crash but shows the local settings... Thanks for your help.
|
|
![]() |
|
ddlittle
Senior Member
Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 May 2012 at 12:16pm |
|
My guess is that you are failing because you loaded the XML resources, rather than the .DLL. I think your crash is in LoadString, because the resource handle isn't set properly.
Unless strTrueFalse is undefined or returns NULL, I can't think of another reason. mit freundlichen grüßen.... - David
|
|
![]() |
|
SMaton
Groupie
Joined: 04 May 2009 Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2012 at 2:39am |
|
Thanks for the reply... I have changed the resource handling to DLLs and it doesn't crash anymore... Unfortunately it doesn't help me with the problem I tried to solve by using the language resources...
I wanted to datepicker to have the language of the application settings... and realized that Codejock relies on Win32 Common Dialogs for this (which always uses the system language; you cannot change this) :( Thanks for your suggestion though
|
|
![]() |
|
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 |