]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/debughlp.cpp
split wxEVT_GRID_CELL_CHANGE into wxEVT_GRID_CELL_CHANGING/ED pair for consistency...
[wxWidgets.git] / src / msw / debughlp.cpp
index cd8e486616ab2101760f19930bb3c65e9cd12788..d2ddec0146f5154cddce7f12bc3d14a6a9361730 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "wx/msw/debughlp.h"
 
-#if wxUSE_DBGHELP
+#if wxUSE_DBGHELP && wxUSE_DYNLIB_CLASS
 
 // ----------------------------------------------------------------------------
 // constants
@@ -145,7 +145,7 @@ const wxString& wxDbgHelpDLL::GetErrorMessage()
 void wxDbgHelpDLL::LogError(const wxChar *func)
 {
     ::OutputDebugString(wxString::Format(_T("dbghelp: %s() failed: %s\r\n"),
-                        func, wxSysErrorMsg(::GetLastError())));
+                        func, wxSysErrorMsg(::GetLastError())).wx_str());
 }
 
 // ----------------------------------------------------------------------------
@@ -391,7 +391,7 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level)
     s.reserve(512);
     s = GetSymbolName(pSym);
 
-#if !wxUSE_STL
+#if !wxUSE_STD_STRING
     // special handling for ubiquitous wxString: although the code below works
     // for it as well, it shows the wxStringBase class and takes 4 lines
     // instead of only one as this branch
@@ -404,18 +404,22 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level)
         // between GetWriteBuf() and UngetWriteBuf() calls) and assert when we
         // try to access it contents using public methods, so instead use our
         // knowledge of its internals
-        const wxChar *p = ps->data();
-        wxStringData *data = (wxStringData *)p - 1;
-        if ( ::IsBadReadPtr(data, sizeof(wxStringData)) ||
-                ::IsBadReadPtr(p, sizeof(wxChar *)*data->nAllocLength) )
+        const wxChar *p = NULL;
+        if ( !::IsBadReadPtr(ps, sizeof(wxString)) )
         {
-            p = _T("???");
+            p = ps->data();
+            wxStringData *data = (wxStringData *)p - 1;
+            if ( ::IsBadReadPtr(data, sizeof(wxStringData)) ||
+                    ::IsBadReadPtr(p, sizeof(wxChar *)*data->nAllocLength) )
+            {
+                p = NULL; // don't touch this pointer with 10 feet pole
+            }
         }
 
-        s << _T("(\"") << p << _T(")\"");
+        s << _T("(\"") << (p ? p : _T("???")) << _T(")\"");
     }
     else // any other UDT
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_STRING
     {
         // Determine how many children this type has.
         DWORD dwChildrenCount = 0;