X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/18680f86512504f043ad5d0b222afc7be87aa3e9..98225d0279de4d074d306b40683667670333be51:/src/msw/ole/activex.cpp

diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp
index 2341500182..e8e7647a48 100644
--- a/src/msw/ole/activex.cpp
+++ b/src/msw/ole/activex.cpp
@@ -23,14 +23,14 @@
     #pragma hdrstop
 #endif
 
+#if wxUSE_ACTIVEX
+
 #ifndef WX_PRECOMP
     #include "wx/dcclient.h"
     #include "wx/math.h"
 #endif
 
-// I don't know why members of tagVARIANT aren't found when compiling
-// with Wine
-#ifndef __WINE__
+#include "wx/msw/dc.h"
 
 #include "wx/msw/ole/activex.h"
 // autointerfaces that we only use here
@@ -896,7 +896,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
             continue;
 
         // check if default event sink
-        bool defInterface = false;
         bool defEventSink = false;
         int impTypeFlags = 0;
         typeInfo->GetImplTypeFlags(i, &impTypeFlags);
@@ -914,11 +913,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
                     wxFAIL_MSG(wxT("Default event sink is in vtable!"));
                 }
             }
-            else
-            {
-                // WXOLE_TRACEOUT("Default Interface");
-                defInterface = true;
-            }
         }
 
 
@@ -1131,8 +1125,9 @@ void wxActiveXContainer::OnPaint(wxPaintEvent& WXUNUSED(event))
         ::InvalidateRect(m_oleObjectHWND, NULL, false);
 #endif
         RECTL *prcBounds = (RECTL *) &posRect;
+        wxMSWDCImpl *msw = wxDynamicCast( dc.GetImpl() , wxMSWDCImpl );
         m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
-            (HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0);
+            (HDC)msw->GetHDC(), prcBounds, NULL, NULL, 0);
     }
 }
 
@@ -1163,5 +1158,4 @@ void wxActiveXContainer::OnKillFocus(wxFocusEvent& event)
     event.Skip();
 }
 
-#endif
-// __WINE__
+#endif // wxUSE_ACTIVEX