Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » GetIniKey is now disallowed when APP_MAIN is not running
GetIniKey is now disallowed when APP_MAIN is not running [message #37019] Thu, 09 August 2012 08:39
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
After disastrous experience I have added this ASSERT_ to GetIniKey:

String GetIniKey(const char *id, const String& def) {
	ASSERT_(IsMainRunning(), "GetIniKey is allowed only after APP_MAIN has started");


The rationale is that many application change the .ini file location and/or name, which can only be done in GUI_APP_MAIN. The disaster (that actually happened to me Smile is then:

String s = GetIniKey("foo"); // loaded from the wrong .ini file

CONSOLE_APP_MAIN
{
	SetIniFile("/etc/bar.ini");

[Updated on: Thu, 09 August 2012 08:40]

Report message to a moderator

Previous Topic: .ini file helpers
Next Topic: FileSel Win32 .exe icons lazy loading refactored
Goto Forum:
  


Current Time: Fri Apr 19 07:28:50 CEST 2024

Total time taken to generate the page: 0.01217 seconds