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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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