From 36f51e147951faad0f719f6f0274b5834dfdf58d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Sep 2014 16:51:02 +0000 Subject: [PATCH] Fix AssocQueryString() error reporting in wxMSW. Don't report ERROR_NO_ASSOCIATION as an (unexpected) error, it is perfectly normal to get it if a command is not defined for the given extension. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/mimetype.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index f917d5c788..21cabbda6f 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -262,11 +262,15 @@ wxString wxAssocQueryString(ASSOCSTR assoc, &dwSize // And its size ); - // Do not use FAILED() here as S_FALSE can be returned but is still an - // error in this context. + // Do not use SUCCEEDED() here as S_FALSE could, in principle, be returned + // but would still be an error in this context. if ( hr != S_OK ) { - wxLogApiError("AssocQueryString", hr); + // The only really expected error here is that no association is + // defined, anything else is not expected. + if ( hr != HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) ) + wxLogApiError("AssocQueryString", hr); + return wxString(); }