git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34155
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_hRootKey; // handle of the top key (i.e. StdKey)
wxString m_strKey; // key name (relative to m_hRootKey)
+ AccessMode m_mode; // valid only if key is opened
long m_dwLastError; // last error (0 if none)
bool wxRegKey::Open(AccessMode mode)
{
if ( IsOpened() )
- return true;
+ {
+ if ( mode <= m_mode )
+ return true;
+
+ // we had been opened in read mode but now must be reopened in write
+ Close();
+ }
HKEY tmpKey;
m_dwLastError = ::RegOpenKeyEx
}
m_hKey = (WXHKEY) tmpKey;
+ m_mode = mode;
+
return true;
}