HRESULT IDocHostUIHandler.GetDropTarget(Ole32.IDropTarget pDropTarget, out Ole32.IDropTarget ppDropTarget)
 {
     // Set to null no matter what we return, to prevent the marshaller
     // from having issues if the pointer points to random stuff.
     ppDropTarget = null;
     return(HRESULT.E_NOTIMPL);
 }
            private static int Drop(IntPtr thisPtr, IntPtr pDataObj, uint grfKeyState, Point pt, uint *pdwEffect)
            {
                Ole32.IDropTarget inst = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
                var dataObject         = WinFormsComWrappers.Instance.GetOrCreateObjectForComInstance(pDataObj, CreateObjectFlags.Unwrap);

                return((int)inst.Drop(dataObject, grfKeyState, pt, ref *pdwEffect));
            }
 private static int DragLeave(IntPtr thisPtr)
 {
     try
     {
         Ole32.IDropTarget instance = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
         return((int)instance.DragLeave());
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
         return(ex.HResult);
     }
 }
 private static int DragOver(IntPtr thisPtr, uint grfKeyState, Point pt, uint *pdwEffect)
 {
     try
     {
         Ole32.IDropTarget instance = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
         return((int)instance.DragOver(grfKeyState, pt, ref *pdwEffect));
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
         return(ex.HResult);
     }
 }
 private static int Drop(IntPtr thisPtr, IntPtr pDataObj, uint grfKeyState, Point pt, uint *pdwEffect)
 {
     try
     {
         Ole32.IDropTarget instance = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
         var dataObject             = WinFormsComWrappers.Instance.GetOrCreateObjectForComInstance(pDataObj, CreateObjectFlags.Unwrap);
         return((int)instance.Drop(dataObject, grfKeyState, pt, ref *pdwEffect));
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
         return(ex.HResult);
     }
 }
 private static int DragLeave(IntPtr thisPtr)
 {
     Ole32.IDropTarget inst = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
     return((int)inst.DragLeave());
 }
 private static int DragOver(IntPtr thisPtr, uint grfKeyState, Point pt, uint *pdwEffect)
 {
     Ole32.IDropTarget inst = ComInterfaceDispatch.GetInstance <Ole32.IDropTarget>((ComInterfaceDispatch *)thisPtr);
     return((int)inst.DragOver(grfKeyState, pt, ref *pdwEffect));
 }