]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textentry.cpp
fixing osx_cocoa
[wxWidgets.git] / src / msw / textentry.cpp
index d3743a25ab8ca7ab77e69a7e34e3c78365c5aab5..77bc4cd1bce5f890efbdfed2fadad128046e2d5d 100644 (file)
@@ -34,6 +34,8 @@
 #include "wx/textcompleter.h"
 #include "wx/dynlib.h"
 
 #include "wx/textcompleter.h"
 #include "wx/dynlib.h"
 
+#include <initguid.h>
+
 #include "wx/msw/private.h"
 
 #if wxUSE_UXTHEME
 #include "wx/msw/private.h"
 
 #if wxUSE_UXTHEME
 
 #include "wx/msw/ole/oleutils.h"
 #include <shldisp.h>
 
 #include "wx/msw/ole/oleutils.h"
 #include <shldisp.h>
-#include <shobjidl.h>
 
 #if defined(__MINGW32__) || defined (__WATCOMC__) || defined(__CYGWIN__)
     // needed for IID_IAutoComplete, IID_IAutoComplete2 and ACO_AUTOSUGGEST
     #include <shlguid.h>
 
 #if defined(__MINGW32__) || defined (__WATCOMC__) || defined(__CYGWIN__)
     // needed for IID_IAutoComplete, IID_IAutoComplete2 and ACO_AUTOSUGGEST
     #include <shlguid.h>
+
+    #ifndef ACO_AUTOAPPEND
+        #define ACO_AUTOAPPEND 0x02
+    #endif
 #endif
 
 #ifndef ACO_UPDOWNKEYDROPSLIST
 #endif
 
 #ifndef ACO_UPDOWNKEYDROPSLIST
     #define SHACF_FILESYS_ONLY 0x00000010
 #endif
 
     #define SHACF_FILESYS_ONLY 0x00000010
 #endif
 
-DEFINE_GUID(CLSID_AutoComplete,
-    0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62);
-
 namespace
 {
 
 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(wxIID_IAutoCompleteDropDown,
+    0x3cd141f4, 0x3c6a, 0x11d2, 0xbc, 0xaa, 0x00, 0xc0, 0x4f, 0xd9, 0x29, 0xdb);
+
+DEFINE_GUID(wxCLSID_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
 // Small helper class which can be used to ensure thread safety even when
 // wxUSE_THREADS==0 (and hence wxCriticalSection does nothing).
 class CSLock
@@ -349,7 +369,7 @@ public:
         // apparently.
         HRESULT hr = CoCreateInstance
                      (
         // apparently.
         HRESULT hr = CoCreateInstance
                      (
-                        CLSID_AutoComplete,
+                        wxCLSID_AutoComplete,
                         NULL,
                         CLSCTX_INPROC_SERVER,
                         IID_IAutoComplete,
                         NULL,
                         CLSCTX_INPROC_SERVER,
                         IID_IAutoComplete,
@@ -384,7 +404,7 @@ public:
         // provided IAutoComplete always implements IAutoCompleteDropDown too.
         hr = m_autoComplete->QueryInterface
                              (
         // provided IAutoComplete always implements IAutoCompleteDropDown too.
         hr = m_autoComplete->QueryInterface
                              (
-                               IID_IAutoCompleteDropDown,
+                               wxIID_IAutoCompleteDropDown,
                                reinterpret_cast<void **>(&m_autoCompleteDropDown)
                              );
         if ( FAILED(hr) )
                                reinterpret_cast<void **>(&m_autoCompleteDropDown)
                              );
         if ( FAILED(hr) )