]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/droptgt.cpp
somehow log target wasn't being created automatically anymore. Restored.
[wxWidgets.git] / src / msw / ole / droptgt.cpp
index 7ff89237d5fb242c9104d42a22f3a9922735151f..b1d2e04fc0fd9fc145ecdef311f6cf090ae14a4e 100644 (file)
@@ -22,7 +22,6 @@
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
-#define IN_WX_MAIN_CPP
 #include "wx/wxprec.h"
 
 #if defined(__BORLANDC__)
 #include "wx/wxprec.h"
 
 #if defined(__BORLANDC__)
@@ -108,7 +107,7 @@ wxIDropTarget::wxIDropTarget(wxDropTarget *pTarget)
 { 
   m_cRef         = 0; 
   m_pTarget      = pTarget;
 { 
   m_cRef         = 0; 
   m_pTarget      = pTarget;
-  m_cfFormat     = 0;
+  m_cfFormat     = (wxDataFormat) 0;
   m_pIDataObject = NULL; 
 }
 
   m_pIDataObject = NULL; 
 }
 
@@ -123,44 +122,6 @@ END_IID_TABLE;
 
 IMPLEMENT_IUNKNOWN_METHODS(wxIDropTarget)
 
 
 IMPLEMENT_IUNKNOWN_METHODS(wxIDropTarget)
 
-#if 0
-  STDMETHODIMP wxIDropTarget::QueryInterface(REFIID riid, void **ppv)
-  {                                                                           
-//    wxLogQueryInterface(wxIDropTarget, riid);                                    
-                                                                              
-    if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) {                  
-      *ppv = this;
-      AddRef();                                                               
-                                                                              
-      return S_OK;                                                            
-    }                                                                         
-    else {                                                                    
-      *ppv = NULL;                                                            
-                                                                              
-      return (HRESULT) E_NOINTERFACE;
-    }                                                                         
-  }                                                                           
-                                                                              
-  STDMETHODIMP_(ULONG) wxIDropTarget::AddRef()                                    
-  {                                                                           
-    wxLogAddRef(wxIDropTarget, m_cRef);                                          
-                                                                              
-    return ++m_cRef;                                                          
-  }                                                                           
-                                                                              
-  STDMETHODIMP_(ULONG) wxIDropTarget::Release()                                   
-  {                                                                           
-    wxLogRelease(wxIDropTarget, m_cRef);                                         
-                                                                              
-    if ( --m_cRef == 0 ) {                                                    
-      delete this;                                                            
-      return 0;                                                               
-    }                                                                         
-    else                                                                      
-      return m_cRef;                                                          
-  }
-#endif
-
 // Name    : wxIDropTarget::DragEnter
 // Purpose : Called when the mouse enters the window (dragging something)
 // Returns : S_OK
 // Name    : wxIDropTarget::DragEnter
 // Purpose : Called when the mouse enters the window (dragging something)
 // Returns : S_OK
@@ -320,7 +281,7 @@ bool wxDropTarget::Register(WXHWND hwnd)
 {
   HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
   if ( FAILED(hr) ) {
 {
   HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
   if ( FAILED(hr) ) {
-    // wxLogApiError("CoLockObjectExternal", hr);
+    wxLogApiError("CoLockObjectExternal", hr);
     return FALSE;
   }
 
     return FALSE;
   }
 
@@ -328,7 +289,7 @@ bool wxDropTarget::Register(WXHWND hwnd)
   if ( FAILED(hr) ) {
     ::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
 
   if ( FAILED(hr) ) {
     ::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
 
-    // wxLogApiError("RegisterDragDrop", hr);
+    wxLogApiError("RegisterDragDrop", hr);
     return FALSE;
   }
 
     return FALSE;
   }
 
@@ -339,9 +300,8 @@ void wxDropTarget::Revoke(WXHWND hwnd)
 {
   HRESULT hr = ::RevokeDragDrop((HWND) hwnd);
 
 {
   HRESULT hr = ::RevokeDragDrop((HWND) hwnd);
 
-  if ( FAILED(hr) )
-  {
-    // wxLogApiError("RevokeDragDrop", hr);
+  if ( FAILED(hr) ) {
+    wxLogApiError("RevokeDragDrop", hr);
   }
 
   ::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
   }
 
   ::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
@@ -369,7 +329,7 @@ bool wxDropTarget::IsAcceptedData(IDataObject *pIDataSource) const
     //   means) for file drag and drop
     if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
       // remember this format: we'll later ask for data in it
     //   means) for file drag and drop
     if ( pIDataSource->QueryGetData(&s_fmtMemory) == S_OK ) {
       // remember this format: we'll later ask for data in it
-      m_pIDropTarget->SetSupportedFormat(s_fmtMemory.cfFormat);
+      m_pIDropTarget->SetSupportedFormat((wxDataFormat) s_fmtMemory.cfFormat);
       return TRUE;
     }
   }
       return TRUE;
     }
   }
@@ -393,7 +353,7 @@ size_t wxTextDropTarget::GetFormatCount() const
 
 wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
 {
 
 wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
 {
-  return CF_TEXT;
+  return wxDF_TEXT;
 }
 
 // ============================================================================
 }
 
 // ============================================================================
@@ -448,10 +408,10 @@ size_t wxFileDropTarget::GetFormatCount() const
 wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
 {
 #ifdef __WIN32__
 wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
 {
 #ifdef __WIN32__
-  return CF_HDROP;
+  return wxDF_FILENAME;
 #else
   // TODO: how to implement this in WIN16?
 #else
   // TODO: how to implement this in WIN16?
-  return CF_TEXT;
+  return wxDF_TEXT;
 #endif
 }
 
 #endif
 }