// - add high level functions (RegisterOleServer, ...)
///////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "registry.h"
#endif
Close();
m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey);
- if ( m_dwLastError != ERROR_SUCCESS ) {
+ // deleting a key 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 key '%s'"),
GetName().c_str());
return FALSE;
strValue.Empty();
}
else {
- RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
WXSTRINGCAST szValue,
RESERVED,
&dwType,
- pBuf,
+ (RegString)(wxChar*)wxStringBuffer(strValue, dwSize),
&dwSize);
- strValue.UngetWriteBuf();
// expand the var expansions in the string unless disabled
#ifndef __WXWINCE__
ok = ::ExpandEnvironmentStrings
(
strValue,
- strExpValue.GetWriteBuf(dwExpSize),
+ wxStringBuffer(strExpValue, dwExpSize),
dwExpSize
) != 0;
- strExpValue.UngetWriteBuf();
strValue = strExpValue;
}