拖放将虚拟文件从 wxWidgets 应用程序拖放到 Windows 资源管理器
我需要将“虚拟文件”从 wxWidgets 应用程序拖放到 Windows 资源管理器。这篇codeproject 文章很好地描述和演示了如何在 MFC 中进行操作。我完全不清楚如何使用 wxWidgets 类( wxDataObject、wxTextDataObject、wxDropSource、wxDropTarget、wxTextDropTarget、wxFileDropTarget )来做同样的事情。谁能给我一些关于如何继续的提示?
动机:我需要拖放位于远程设备上的文件。将它们从设备中拉出并根据需要重新格式化需要几秒钟 - 如果选择了许多文件,则需要几分钟。如果在拖动开始但在放置之前下载并重新格式化文件,则延迟会使拖放完全无法使用。使用虚拟文件可以完成拖放,然后才复制文件 - 这使得拖放操作变得流畅且用户熟悉。
这是相关的stackoverflow问题 - 但它是针对 MFC 的,我需要一个 wxWidgets 解决方案。
因此,我尝试遵循 codeproject 示例并专门研究 COleDataSource。但是,当我包含 afxole.h 时,编译器会抱怨
Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
这看起来并不乐观。
我现在的想法是我必须使用 IDataObject。这看起来合理吗?有人可以给我简单介绍一下如何使用它吗?
I need to drag and drop 'virtual files' from a wxWidgets application to windows explorer. This codeproject article is an excellent description and demonstration of how to do in MFC. It is not at all clear to me how to use the wxWidgets classes ( wxDataObject, wxTextDataObject, wxDropSource, wxDropTarget, wxTextDropTarget, wxFileDropTarget ) to do the same thing. Can anyone give me some hints on how to proceed?
Motivation: I need to drag and drop files that are located on a remote device. Pulling them from the device and reformatting them as required takes many seconds - minutes if many files are selected. The delay makes the drag and drop completely unusable if the files are downloaded and reformatted when the drag starts but before the drop. Using a virtual file allows the drop to be completed, and only then are the files copied - this makes the drag'n'drop smooth and familiar to the user.
Here is a related stackoverflow question - but it is for MFC and I need a wxWidgets solution.
So, I tried following the codeproject example and specializing COleDataSource. However, when I include afxole.h the compiler complains
Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
This does not look hopeful.
My thought now is I am going to have to use IDataObject. Does that seem reasonable? Can someone point me to a gentle introduction to using this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论