Drag and Drop to explorer causing invalid FORMATETC (DV_E_FORMATETC) error

Posted by JustABill on Stack Overflow See other posts from Stack Overflow or by JustABill
Published on 2010-05-27T01:47:14Z Indexed on 2010/05/27 1:51 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

I'm trying to use this excellent example to implement dropping virtual files into Windows Explorer. However, I'm stymied by this error. Towards the bottom, inside void System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium) on the first call to ((System.Runtime.InteropServices.ComTypes.IDataObject)this).GetDataHere(ref formatetc, ref medium); I'm getting back a DV_E_FORMATETC error. As far as I can tell, all the elements of the FORMATETC struct that are being passed in are valid: cfFormat is "Shell IDList Array" (-16141), ptd is 0, dwAspect is DVASPECT_CONTENT, lindex is -1, and tymed is TYMED_HGLOBAL. I'm kind of confused how there'd be a problem anyway, since this was generated by explorer.

I know very little about COM interaction, so any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about com