From 78f250a46df67bc0f7df4b93290e407d50cc174f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Apr 2011 15:47:37 +0000 Subject: [PATCH] Redefine IAutoCompleteDropDown in our code as it's not always available. MinGW doesn't have shobjidl.h header file which is normally part of the Platform SDK and doesn't have IAutoCompleteDropDown interface definition in any of its headers at all, so define this interface and its IID ourselves to make the code compile with it. Notice that MinGW-64 does have the interface declaration but still doesn't define IID_IAutoCompleteDropDown. So to be on the safe side just always define everything ourselves, as long as we need to do it for one of the compilers, it's not more difficult to do it for all of them. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textentry.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index d3743a25ab..0ccc7aacf1 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -55,7 +55,6 @@ #include "wx/msw/ole/oleutils.h" #include -#include #if defined(__MINGW32__) || defined (__WATCOMC__) || defined(__CYGWIN__) // needed for IID_IAutoComplete, IID_IAutoComplete2 and ACO_AUTOSUGGEST @@ -70,12 +69,27 @@ #define SHACF_FILESYS_ONLY 0x00000010 #endif -DEFINE_GUID(CLSID_AutoComplete, - 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); - namespace { +// Normally this interface and its IID are defined in shobjidl.h header file +// included in the platform SDK but MinGW and Cygwin don't have it so redefine +// the interface ourselves and, as long as we do it all, do it for all +// compilers to ensure we have the same behaviour for all of them and to avoid +// the need to check for concrete compilers and maybe even their versions. +class IAutoCompleteDropDown : public IUnknown +{ +public: + virtual HRESULT wxSTDCALL GetDropDownStatus(DWORD *, LPWSTR *) = 0; + virtual HRESULT wxSTDCALL ResetEnumerator() = 0; +}; + +DEFINE_GUID(IID_IAutoCompleteDropDown, + 0x3cd141f4, 0x3c6a, 0x11d2, 0xbc, 0xaa, 0x00, 0xc0, 0x4f, 0xd9, 0x29, 0xdb); + +DEFINE_GUID(CLSID_AutoComplete, + 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); + // Small helper class which can be used to ensure thread safety even when // wxUSE_THREADS==0 (and hence wxCriticalSection does nothing). class CSLock -- 2.45.2