Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Bug in handling .ini resources
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in handling .ini resources

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

Joined: 20 August 2015
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote andreypir Quote  Post ReplyReply Direct Link To This Post Topic: Bug in handling .ini resources
    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.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
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.188 seconds.