bool preClient::OnInitialize (int argc, char* argv[]) { // Set up the configuration manager. if (!celInitializer::SetupConfigManager (object_reg, 0, GetApplicationName ())) { return ReportError ("Failed to initialize configuration manager!"); } // end if // Get our references to the VFS plugin and the configuration manager. vfs = csQueryRegistry<iVFS> (object_reg); if (!vfs) { return ReportError ("Can't find the virtual file system!"); } // end if applicationConfig = csQueryRegistry<iConfigManager> (object_reg); if (!applicationConfig) { return ReportError ("Can't find the config manager!"); } // end if // Load the common Precursors application configuration. applicationConfig->AddDomain ("/precursors/config/preCommon.cfg", vfs, 0); // Load the Precursors client configuration. applicationConfig->AddDomain ("/precursors/config/preClient.cfg", vfs, 1); // Create the user's configuration directory for Precursors if it doesn't already exist. // Load the user's configuration file. csRef<iConfigFile> userConfig = applicationConfig->AddDomain ( "/user/config/preClient.cfg", vfs, 10); // Set the user's configuration to the dynamic domain. applicationConfig->SetDynamicDomain (userConfig);<snip> // Add bookmark to the configuration file. csString bookmarkName = "Precursors.Client.ServerBookmarks."; bookmarkName.Append (name); if (port == 0) { applicationConfig->SetStr (bookmarkName, address); } else { csString bookmark; bookmark.Format ("%s:%u", address, port); applicationConfig->SetStr (bookmarkName, bookmark); } // end if