X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/873aefb8b92ed74919919cf62eef71d6fdf6eca0..dc134969ef4efd78faccc19fa616d715ab39c5f8:/src/msw/registry.cpp?ds=inline diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 33eb4fae36..f35ecd279c 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/registry.cpp +// Name: src/msw/registry.cpp // Purpose: implementation of registry classes and functions // Author: Vadim Zeitlin // Modified by: @@ -12,21 +12,19 @@ // - add high level functions (RegisterOleServer, ...) /////////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "registry.h" -#endif - // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" #endif -// other wxWidgets headers -#include "wx/string.h" -#include "wx/intl.h" -#include "wx/log.h" #include "wx/file.h" #include "wx/wfstream.h" @@ -710,20 +708,21 @@ bool wxRegKey::DeleteKey(const wxChar *szKey) bool wxRegKey::DeleteValue(const wxChar *szValue) { - if ( !Open() ) - return false; + if ( !Open() ) + return false; m_dwLastError = RegDeleteValue((HKEY) m_hKey, WXSTRINGCAST szValue); // deleting a value which doesn't exist is not considered an error if ( (m_dwLastError != ERROR_SUCCESS) && - (m_dwLastError != ERROR_FILE_NOT_FOUND) ) { - wxLogSysError(m_dwLastError, _("Can't delete value '%s' from key '%s'"), - szValue, GetName().c_str()); - return false; + (m_dwLastError != ERROR_FILE_NOT_FOUND) ) + { + wxLogSysError(m_dwLastError, _("Can't delete value '%s' from key '%s'"), + szValue, GetName().c_str()); + return false; } - return true; + return true; } // ---------------------------------------------------------------------------- @@ -733,8 +732,8 @@ bool wxRegKey::DeleteValue(const wxChar *szValue) // return true if value exists bool wxRegKey::HasValue(const wxChar *szValue) const { - // this function should be silent, so suppress possible messages from Open() - wxLogNull nolog; + // this function should be silent, so suppress possible messages from Open() + wxLogNull nolog; if ( !CONST_CAST Open(Read) ) return false; @@ -900,7 +899,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue, { // first get the type and size of the data - DWORD dwType, dwSize; + DWORD dwType=REG_NONE, dwSize=0; m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED, &dwType, NULL, &dwSize); if ( m_dwLastError == ERROR_SUCCESS ) @@ -1416,4 +1415,3 @@ void RemoveTrailingSeparator(wxString& str) if ( !str.empty() && str.Last() == REG_SEPARATOR ) str.Truncate(str.Len() - 1); } -