Print Page | Close Window

Bug in handling .ini resources

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23366
Printed Date: 23 December 2024 at 10:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug in handling .ini resources
Posted By: andreypir
Subject: Bug in handling .ini resources
Date Posted: 16 June 2017 at 1:54pm
There appears to be a bug introduced in version 17.2 and still existing in 17.3. When theme definition .ini file is included in resources, like this: 

INSIGHT3_THEME_INI TEXTFILE MOVEABLE PURE "Res/Insight3Theme.ini"

it is ignored. The settings are loaded correctly by CXTPResourceImages::LoadResources (called from the main frame constructor)but m_strIniFileName is not initialized and remains empty. When later a theme is set, for example

CXTPPaintManager::SetTheme(xtpThemeVisualStudio2012Dark)

the code tries to use the loaded .ini file, but XTPIniColor is NOP because XTPResourceImages()->m_strIniFileName.IsEmpty(). As a result .ini file theme customization is lost.

A simple work around is to initialize m_strIniFileName before a call to SetTheme, for example

XTPResourceImages()->m_strIniFileName = _T("INSIGHT3_THEME_INI");

I believe a bugfix should either set m_strIniFileName in CXTPResourceImages::LoadResources or change logic of XTPIniColor.



Replies:
Posted By: olebed
Date Posted: 21 June 2017 at 5:58am
Hello,

Before v17.2  m_strIniFileName was initialized with  _T("OFFICE2007BLUE_INI"). In v17.2 with empty sting.

So anyway you need to set XTPResourceImages()->m_strIniFileName = _T("INSIGHT3_THEME_INI");

Regards,
 Oleksandr Lebed



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net