拖放到资源管理器,导致无效的FORMATETC(DV_E_FORMATETC)错误 [英] Drag and Drop to explorer causing invalid FORMATETC (DV_E_FORMATETC) error

查看:722
本文介绍了拖放到资源管理器,导致无效的FORMATETC(DV_E_FORMATETC)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用这个出色的示例来实现删除虚拟文件导入Windows资源管理器。但是,我被这个错误阻止。到底部, void System.Runtime.InteropServices.ComTypes.IDataObject.GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatetc,out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)在第一次调用((System.Runtime.InteropServices.ComTypes.IDataObject)this).GetDataHere(ref formatetc,ref medium); 返回 DV_E_FORMATETC 错误。据我所知,传递的所有FORMATETC结构的元素都是有效的:cfFormat是Shell IDList Array(-16141),ptd是0,dwAspect是DVASPECT_CONTENT,lindex是-1,tymed是TYMED_HGLOBAL。我很困惑如何会有一个问题,无论如何,因为这是由探测器生成。

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.

我很少了解COM交互,所以任何帮助将是非常感谢。

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

推荐答案

重新实现了大约一半的IDataObject之后,结果是错误代码是由不支持Shell IDList Array in GetDataPresent()。

After reimplementing about half of IDataObject, it turns out that error code is caused by not supporting "Shell IDList Array" in GetDataPresent().

这篇关于拖放到资源管理器,导致无效的FORMATETC(DV_E_FORMATETC)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆