X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d38f70b2494626c4c04dbec17b48d1029b7bcd10..ccd5d46c7b69632eaa231e8fc7801dd5af2faaa8:/src/msw/registry.cpp?ds=sidebyside diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 6ba78d3c25..4067064673 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -19,6 +19,8 @@ #pragma hdrstop #endif +#if wxUSE_REGKEY + #ifndef WX_PRECOMP #include "wx/msw/wrapwin.h" #include "wx/string.h" @@ -383,7 +385,7 @@ bool wxRegKey::Open(AccessMode mode) m_dwLastError = ::RegOpenKeyEx ( (HKEY) m_hRootKey, - m_strKey.wx_str(), + m_strKey.t_str(), RESERVED, mode == Read ? KEY_READ : KEY_ALL_ACCESS, &tmpKey @@ -424,7 +426,7 @@ bool wxRegKey::Create(bool bOkIfExists) &tmpKey, &disposition); #else - m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.wx_str(), &tmpKey); + m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.t_str(), &tmpKey); #endif if ( m_dwLastError != ERROR_SUCCESS ) { wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"), @@ -696,7 +698,7 @@ bool wxRegKey::DeleteSelf() // now delete this key itself Close(); - m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.wx_str()); + m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.t_str()); // deleting a key which doesn't exist is not considered an error if ( m_dwLastError != ERROR_SUCCESS && m_dwLastError != ERROR_FILE_NOT_FOUND ) { @@ -940,12 +942,12 @@ bool wxRegKey::QueryValue(const wxString& szValue, #ifndef __WXWINCE__ if ( (dwType == REG_EXPAND_SZ) && !raw ) { - DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.wx_str(), NULL, 0); + DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.t_str(), NULL, 0); bool ok = dwExpSize != 0; if ( ok ) { wxString strExpValue; - ok = ::ExpandEnvironmentStrings(strValue.wx_str(), + ok = ::ExpandEnvironmentStrings(strValue.t_str(), wxStringBuffer(strExpValue, dwExpSize), dwExpSize ) != 0; @@ -1195,7 +1197,7 @@ FormatAsHex(const void *data, // write all the rest as comma-separated bytes value.reserve(3*size + 10); - const char * const p = wx_static_cast(const char *, data); + const char * const p = static_cast(data); for ( size_t n = 0; n < size; n++ ) { // TODO: line wrapping: although not required by regedit, this makes @@ -1362,7 +1364,7 @@ bool wxRegKey::DoExport(wxOutputStream& ostr) const // dump all our values long dummy; wxString name; - wxRegKey& self = wx_const_cast(wxRegKey&, *this); + wxRegKey& self = const_cast(*this); bool cont = self.GetFirstValue(name, dummy); while ( cont ) { @@ -1406,7 +1408,7 @@ bool KeyExists(WXHKEY hRootKey, const wxString& szKey) if ( ::RegOpenKeyEx ( (HKEY)hRootKey, - szKey.wx_str(), + szKey.t_str(), RESERVED, KEY_READ, // we might not have enough rights for rw access &hkeyDummy @@ -1442,5 +1444,7 @@ inline void RemoveTrailingSeparator(wxString& str) inline const wxChar *RegValueStr(const wxString& szValue) { - return szValue.empty() ? (const wxChar*)NULL : szValue.wx_str(); + return szValue.empty() ? (const wxChar*)NULL : szValue.t_str(); } + +#endif // wxUSE_REGKEY