X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..0f1c3d30d4a699817340ce56e752b61b78cccb1c:/src/msw/registry.cpp diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index dbfb079c8c..57eea64341 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -294,6 +294,18 @@ void wxRegKey::SetHkey(WXHKEY hKey) Close(); m_hKey = hKey; + + // we don't know the parent of this key, assume HKLM by default + m_hRootKey = HKEY_LOCAL_MACHINE; + + // we don't know in which mode was this key opened but we can't reopen it + // anyhow because we don't know its name, so the only thing we can is to hope + // that it allows all the operations which we're going to perform on it + m_mode = Write; + + // reset old data + m_strKey.empty(); + m_dwLastError = 0; } // ----------------------------------------------------------------------------