wxString str(bStr, len);
#else
wxString str;
- if ( !::WideCharToMultiByte(CP_ACP, 0 /* no flags */,
- bStr, len /* not necessary NUL-terminated */,
- wxStringBuffer(str, len + 1), len + 1,
- NULL, NULL /* no default char */) )
+ if (len)
{
- str.clear();
+ wxStringBufferLength buf(str, len); // asserts if len == 0
+ buf.SetLength(WideCharToMultiByte(CP_ACP, 0 /* no flags */,
+ bStr, len /* not necessarily NUL-terminated */,
+ buf, len,
+ NULL, NULL /* no default char */));
}
#endif
// Debug support
// ----------------------------------------------------------------------------
-#if defined(__WXDEBUG__) && ( ( defined(__VISUALC__) && (__VISUALC__ > 1000) ) || defined(__MWERKS__) )
+#if wxDEBUG_LEVEL && ( ( defined(__VISUALC__) && (__VISUALC__ > 1000) ) || defined(__MWERKS__) )
static wxString GetIidName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
wxLogTrace(wxTRACE_OleCalls, wxT("After %s::Release: m_cRef = %d"), szInterface, cRef - 1);
}
-#elif defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ <= 1000)
+#endif // wxDEBUG_LEVEL
-// For VC++ 4
-void wxLogQueryInterface(const char *szInterface, REFIID riid)
-{
- wxLogTrace("%s::QueryInterface", szInterface);
-}
+#endif // wxUSE_DRAG_AND_DROP
-void wxLogAddRef(const char *szInterface, ULONG cRef)
-{
- wxLogTrace("After %s::AddRef: m_cRef = %d", szInterface, cRef + 1);
-}
-
-void wxLogRelease(const char *szInterface, ULONG cRef)
-{
- wxLogTrace("After %s::Release: m_cRef = %d", szInterface, cRef - 1);
-}
+#endif // __CYGWIN10__
-#endif // __WXDEBUG__
-
-#endif
- // wxUSE_DRAG_AND_DROP
-
-#endif
- // __CYGWIN10__
-
-#endif
- // wxUSE_OLE
+#endif // wxUSE_OLE