Windows error 0x80040064, -2147221404

Detailed Error Information

DV_E_FORMATETC[1]

MessageInvalid FORMATETC structure
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode4 (0x004)
NameFACILITY_ITF[2][1]
DescriptionThe source of the error code is COM/OLE Interface management.[2][1]
Error Code100 (0x0064)

Questions

8votes
3answers

Cryptic exception copy/pasting from DataGridView into Excel 2002

Good Morning, Running Visual Studio 2008 (C# 3.5). DataGridView is loaded manually (not data bound). Copy/pasting into Notepad/Wordpad works fine, but when I try to copy/paste into Excel I get this weird Exception: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC)) This was working as of last Friday. I'm completely [...] read more
c#
.net
winforms
excel
5votes
1answer

Drag/drop from outlook to internet explorer via BHO doesn't work on x32/86 machines

I'm currently implementing a browser helper object which would allow dragging emails from the outlook to the internet explorer's page. I'm following the approach described in the following post: Implementing a Drag-and-Drop function from MS Outlook into our web application. I've got it working but only on x64 machines. On [...] read more
c#
internet-explorer
outlook
interop
bho
3votes
1answer

What could possibly cause COMExceptions while dragging file over the Desktop?

It doesn't crash, all the exceptions I mention here can only be seen in Output window of Visual Studio. Here is the implementation of Dragging: WPF: <StackPanel Orientation="Vertical" MouseDown="DragShortcut" x:Name="Shortcut"> <Image Source="{Binding Icon}"/> <Label Content="{Binding ShortcutLabel}"/> </StackPanel> cs code: private void DragShortcut(object sender, MouseButtonEventArgs e) { if (e.LeftButton != MouseButtonState.Pressed) [...] read more
c#
wpf
drag-and-drop
drag
comexception
3votes
3answers

TreeView Drag & Drop help - _Invalid FORMATETC structure_ exception

I'm trying to implement Drag & Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting: Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC)) The ItemDrag handler (where the exception takes place), looks like: private void treeView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { this.DoDragDrop(e.Item, [...] read more
c#
.net
winforms
3votes
1answer

C# DoDragDrop on Non-Serializable object

I have a UserControl that can be dragged around my form. I get a first chance exception when the control is accidentally dragged away from my form and into the desktop (as an example): A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Windows.Forms.dll Additional information: Invalid FORMATETC structure (Exception [...] read more
c#
winforms
exception
drag-and-drop
2votes
1answer

Drag And Drop C# Windows Form Application From another Application

I am trying to drag from another windows application (EM Client, thunderbird or outlook) onto my form. When an email is dragged from the other application to windows explore it will drop as a file. If the user drags onto my application I would like to get the file contents [...] read more
c#
uwp
drag-and-drop
2votes
2answers

Drag Gmail attachment to c# winform

i'm trying to have may application accept attachments dragged in from the Gmail web page. But when i drag in a attachment , directly from the site e.Data does nor seem to contain the data in any way. private void Form1_DragDrop(object sender, DragEventArgs e) { string[] dataFormats = e.Data.GetFormats(); Type [...] read more
c#
drag-and-drop
2votes
0answers

Problems hooking olesetclipboard

Goal: While running inside another process (... Say a plugin inside an Office application like Word), intercept the calls to OleSetClipboard/OleGetClipboard and proxy the iDataObject interface by replacing the object originally set/get by the application with one we control, passing on calls to the original object as needed. Essentially, I [...] read more
winapi
visual-c++
vsto
hook
office-interop
2votes
3answers

How do I copy a file to the clipboard and paste it somewhere else?

I have a listview with small thumbnails of images. Each image has a tag with it's full path in it. With a rightclick menu the user can click COPY. Then this code is excecuted: Dim selectedfile As String selectedfile = Me.lvFotos.SelectedItems(0).Tag Dim dataobj As New DataObject(DataFormats.FileDrop, selectedfile) Clipboard.Clear() Clipboard.SetDataObject(dataobj) Now [...] read more
vb.net
clipboarddata
2votes
0answers

Shell Style Drag and Drop object disposal using gdi32.dll DeleteObject

So... I have recently been developing a Winforms C# application in .NET 2.0 that uses the Shell Style drag and drop described in the great tutorial here: http://blogs.msdn.com/b/adamroot/archive/2008/02/19/shell-style-drag-and-drop-in-net-wpf-and-winforms.aspx This was used to give a semi-transparent image of the dragged control during the drag action. However, a secondary functionality is that [...] read more
c#
drag-and-drop
gdi
windows-shell
dispose
1vote
1answer

MathType in C# (OLE)

I'm trying to run a MathType in a C# app... using OLE in forms to signify the equations/images. This is how I started with the code. I got the CLSID object for math type equation. I create a new instance and run a verb to start Math Type. This works [...] read more
c#
com
ole
mathml
mathtype
0votes
0answers

Drag and drop image from wpf application to uwp application

I am trying to drag an image from WPF application to UWP application but getting this error "invalid formatetc structure (exception from hresult: 0x80040064 (dv_e_formatetc)) in GetStorageItemsAsync method" public async void OnFileDrop(object sender, DragEventArgs e) { List<StorageFile> dropFiles = new List<StorageFile>(); if (e.DataView.Contains(StandardDataFormats.StorageItems)) { var items = await e.DataView.GetStorageItemsAsync(); var [...] read more
image
uwp
drag-and-drop
uwp-xaml
drop
0votes
0answers

Problem with Drag&Drop virtual file in .NET app

I've downloaded the example app from blog: https://dlaa.me/blog/post/9913083 which contains the code to allow dropping file which is first downloaded from the web or any different source (virtual one). I haven't change the code a bit but experience following problem. When dropping on desktop (or any other explorer location) I [...] read more
c#
.net
wpf
drag-and-drop
0votes
1answer

WPF Drag & Drop to External Application (Outlook)

I am attempting to implement some additional Drag & Drop functionality to my WPF application. I have Drag & Drop working when the source and target are within my application, but I need to be able to drag data from my application to Outlook (Desktop App) and have it be [...] read more
c#
wpf
drag-and-drop
export
0votes
0answers

Exception when casting IOleDropTarget pDataObj object - Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC)

I have implemented the IOleDropTarget interface and am also using the IDropTargetHelper interface to show the system icon of the file being dragged. Part of my DragEnter code looks like this Public Function OleDragEnter(<[In]> <MarshalAs(UnmanagedType.Interface)> pDataObj As Object, <[In]> <MarshalAs(UnmanagedType.U4)> grfKeyState As Integer, <[In]> <MarshalAs(UnmanagedType.U8)> pt As Long, <[In]> <Out> [...] read more
vb.net
winapi
outlook
drag-and-drop
0votes
0answers

Save text from MS Word document from clipboard to variable and back with Interop

I have this code that take all MS Word document, save it to clipboard, save clipboard to variable a finally put it back to clipboard. It all run in BackgroundWorker, but that should not be problem. wordDoc.StoryRanges[WdStoryType.wdMainTextStory].Copy(); IDataObject originalWordDocument = null; System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() => originalWordDocument = Clipboard.GetDataObject())); ... System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() [...] read more
c#
ms-word
interop
clipboard
0votes
1answer

How handle when mouse leaves form during drag and drop

I have my form set up to be able to drop files into a textbox, and also drag the files out of the textbox, thus clearing the textbox. The kicker is that the drag out of the textbox has to be dropped on the form. If I try to drag [...] read more
vb.net

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0