From 8fd00bbf88805fc3832ae90ddbb30cfb98cdc749 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Nov 2007 15:16:33 +0000 Subject: [PATCH] handle NULL BSTRs as empty ones per Microsoft convention git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/oleutils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp index 058f4afd87..cfae38d0d6 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -84,6 +84,11 @@ WXDLLEXPORT BSTR wxConvertStringToOle(const wxString& str) WXDLLEXPORT wxString wxConvertStringFromOle(BSTR bStr) { + // NULL BSTR is equivalent to an empty string (this is the convention used + // by VB and hence we must follow it) + if ( !bStr ) + return wxString(); + #if wxUSE_UNICODE wxString str(bStr); #else