]> git.saurik.com Git - wxWidgets.git/commitdiff
Provide stand-in IDropTargetHelper definition to fix VC6 build.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Oct 2012 14:42:58 +0000 (14:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Oct 2012 14:42:58 +0000 (14:42 +0000)
VC6 SDK doesn't define this interface, so do it ourselves to fix its build
after the changes of r72668.

See #14697.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/ole/droptgt.h
src/msw/ole/droptgt.cpp

index d58b1cc42601ca81d974f318d11787d273e9acc5..7b6599092293fa031825582762e879aaf566bd78 100644 (file)
@@ -19,7 +19,7 @@
 // ----------------------------------------------------------------------------
 
 class  wxIDropTarget;
-struct IDropTargetHelper;
+struct wxIDropTargetHelper;
 struct IDataObject;
 
 // ----------------------------------------------------------------------------
@@ -80,7 +80,7 @@ private:
 
     wxIDropTarget     *m_pIDropTarget; // the pointer to our COM interface
     IDataObject       *m_pIDataSource; // the pointer to the source data object
-    IDropTargetHelper *m_dropTargetHelper; // the pointer to the drop target helper
+    wxIDropTargetHelper *m_dropTargetHelper; // the drop target helper
 
     wxDECLARE_NO_COPY_CLASS(wxDropTarget);
 };
index 1c68f26e4a9e231c05753c5d7baf5e8ba84d50db..e8b14c38194a71136f3f721c8983c40cf352aa5e 100644 (file)
 
 #include "wx/msw/ole/oleutils.h"
 
+#include <initguid.h>
+
+// Some (very) old SDKs don't define IDropTargetHelper, so define our own
+// version of it here.
+struct wxIDropTargetHelper : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE DragEnter(HWND hwndTarget,
+                                                IDataObject *pDataObject,
+                                                POINT *ppt,
+                                                DWORD dwEffect) = 0;
+    virtual HRESULT STDMETHODCALLTYPE DragLeave() = 0;
+    virtual HRESULT STDMETHODCALLTYPE DragOver(POINT *ppt, DWORD dwEffect) = 0;
+    virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject *pDataObject,
+                                           POINT *ppt,
+                                           DWORD dwEffect) = 0;
+    virtual HRESULT STDMETHODCALLTYPE Show(BOOL fShow) = 0;
+};
+
+namespace
+{
+    DEFINE_GUID(wxIID_IDropTargetHelper,
+                0x4657278B,0x411B,0x11D2,0x83,0x9A,0x00,0xC0,0x4F,0xD9,0x18,0xD0);
+}
+
 // ----------------------------------------------------------------------------
 // IDropTarget interface: forward all interesting things to wxDropTarget
 // (the name is unfortunate, but wx_I_DropTarget is not at all the same thing
@@ -581,7 +605,7 @@ wxDropTarget::MSWInitDragImageSupport()
 {
     // Use the default drop target helper to show shell drag images
     CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER,
-                     IID_IDropTargetHelper, (LPVOID*)&m_dropTargetHelper);
+                     wxIID_IDropTargetHelper, (LPVOID*)&m_dropTargetHelper);
 }
 
 void