From 795b0f144495454aac0dc23e865f7a8f87f6dfa3 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/trunk@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 1c37542f38..8fbcf99885 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -75,6 +75,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 -- 2.45.2