CRegStdBase::CRegStdBase (const stdstring& key, bool force, HKEY base) : CRegBaseCommon<stdstring> (key, force, base) { stdstring::size_type pos = key.find_last_of(_T('\\')); m_path = key.substr(0, pos); m_key = key.substr(pos + 1); }
/** * Constructor. * @param key the path to the key, including the key. example: "Software\\Company\\SubKey\\MyValue" * @param def the default value used when the key does not exist or a read error occured * @param force set to TRUE if no cache should be used, i.e. always read and write directly from/to registry * @param base a predefined base key like HKEY_LOCAL_MACHINE. see the SDK documentation for more information. */ CRegStdWORD::CRegStdWORD(stdstring key, DWORD def, BOOL force, HKEY base) { m_value = 0; m_defaultvalue = def; m_force = force; m_base = base; m_read = FALSE; stdstring::size_type pos = key.find_last_of(_T('\\')); m_path = key.substr(0, pos); m_key = key.substr(pos + 1); read(); }