]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/activex.cpp
Better fix
[wxWidgets.git] / src / msw / ole / activex.cpp
index 4b5a415e64389781ff6f7e4162037c69869c0da1..e8e7647a4850c8cc6ccfc25a1ff095d4455a9dac 100644 (file)
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
-#include "wx/dcclient.h"
-#include "wx/math.h"
+#if wxUSE_ACTIVEX
 
 
-// I don't know why members of tagVARIANT aren't found when compiling
-// with Wine
-#ifndef __WINE__
+#ifndef WX_PRECOMP
+    #include "wx/dcclient.h"
+    #include "wx/math.h"
+#endif
+
+#include "wx/msw/dc.h"
 
 #include "wx/msw/ole/activex.h"
 // autointerfaces that we only use here
 
 #include "wx/msw/ole/activex.h"
 // autointerfaces that we only use here
@@ -894,7 +896,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
             continue;
 
         // check if default event sink
             continue;
 
         // check if default event sink
-        bool defInterface = false;
         bool defEventSink = false;
         int impTypeFlags = 0;
         typeInfo->GetImplTypeFlags(i, &impTypeFlags);
         bool defEventSink = false;
         int impTypeFlags = 0;
         typeInfo->GetImplTypeFlags(i, &impTypeFlags);
@@ -912,11 +913,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
                     wxFAIL_MSG(wxT("Default event sink is in vtable!"));
                 }
             }
                     wxFAIL_MSG(wxT("Default event sink is in vtable!"));
                 }
             }
-            else
-            {
-                // WXOLE_TRACEOUT("Default Interface");
-                defInterface = true;
-            }
         }
 
 
         }
 
 
@@ -946,7 +942,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
                 hret = cp->Advise(new wxActiveXEvents(this, ta->guid),
                                   &adviseCookie);
                 wxASSERT_MSG( SUCCEEDED(hret),
                 hret = cp->Advise(new wxActiveXEvents(this, ta->guid),
                                   &adviseCookie);
                 wxASSERT_MSG( SUCCEEDED(hret),
-                    wxString::Format(wxT("Cannot connect!\nHRESULT:%X"), hret)
+                    wxString::Format(wxT("Cannot connect!\nHRESULT:%X"), (unsigned int)hret)
                             );
             }
         }
                             );
             }
         }
@@ -1129,8 +1125,9 @@ void wxActiveXContainer::OnPaint(wxPaintEvent& WXUNUSED(event))
         ::InvalidateRect(m_oleObjectHWND, NULL, false);
 #endif
         RECTL *prcBounds = (RECTL *) &posRect;
         ::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,
         m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
-            (HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0);
+            (HDC)msw->GetHDC(), prcBounds, NULL, NULL, 0);
     }
 }
 
     }
 }
 
@@ -1161,5 +1158,4 @@ void wxActiveXContainer::OnKillFocus(wxFocusEvent& event)
     event.Skip();
 }
 
     event.Skip();
 }
 
-#endif
-// __WINE__
+#endif // wxUSE_ACTIVEX