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
Messages: 14256 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 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
|
|
|
Goto Forum:
Current Time: Wed Apr 30 01:01:01 CEST 2025
Total time taken to generate the page: 8.33636 seconds
|