]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/registry.cpp
Compilaton fixes.
[wxWidgets.git] / src / msw / registry.cpp
index caf1a31d159ea92dc05adb530a2e5b137fde79e1..c18f1de8d4c21b2707faddda9064e5f7e5a2bedb 100644 (file)
@@ -36,7 +36,7 @@
 #define   WIN32_LEAN_AND_MEAN
 */
 
-#include  <windows.h>
+#include  "wx/msw/wrapwin.h"
 
 #ifdef __WXWINCE__
 #include "wx/msw/private.h"
@@ -94,7 +94,7 @@ aStdKeys[] =
 
 // useful for Windows programmers: makes somewhat more clear all these zeroes
 // being passed to Windows APIs
-#define   RESERVED        (NULL)
+#define   RESERVED        (0)
 
 // ----------------------------------------------------------------------------
 // macros
@@ -872,14 +872,12 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
             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__
@@ -893,10 +891,9 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
                     ok = ::ExpandEnvironmentStrings
                            (
                             strValue,
-                            strExpValue.GetWriteBuf(dwExpSize),
+                            wxStringBuffer(strExpValue, dwExpSize),
                             dwExpSize
                            ) != 0;
-                    strExpValue.UngetWriteBuf();
                     strValue = strExpValue;
                 }