如何将文件从文件夹拖放到MFC C ++ VS2010中的文本框 [英] how drag and drop a file from folder to textbox in MFC C++ VS2010

查看:119
本文介绍了如何将文件从文件夹拖放到MFC C ++ VS2010中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在MFC C ++ VS2010中遇到有关句柄的问题.要求是用户可以单击以从文件夹或桌面中选择任何文件(在这种情况下为文本文件),然后将其拖放到文本框(使用VS2010的C ++ MFC中的对话框应用程序).此文本框将获取并显示该文件的完整路径,然后读取文件包含并显示到网格.

我在MFC中没有很多工作时间,但是我可以在C ++中读取/写入文件,所以我最大的问题是如何通过C ++(VS2010)将文件拖放到文本框并在MFC中使用Grid. >
如果您曾经遇到过这个问题.请帮帮我.
我非常需要您的帮助!

在此先感谢

Hi all,

I have a problem about handle in MFC C++ VS2010. The requirement is user can click to choose any file(in this case is text file) from a folder or desktop and then drag and drop it to textbox(dialog application in C++ MFC using VS2010). This textbox will get and display full path of that file and then read contain of file and show to grid.

I don''t have a lot of working time in MFC, but I can read/write file in C++, so my biggest problem is how to drag&drop a file to textbox and using Grid in MFC by C++(VS2010).

If you used to meet this issue. please help me.
I need your help very much!

Thanks in advance

推荐答案

首先,请阅读以下内容: http ://msdn.microsoft.com/zh-CN/vstudio/bb905826.aspx [ ^ ]

更多信息,请访问:
http://www.tenouk.com/visualcplusmfc/visualcplusmfc25a.html [ http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c4145/Using-MFC-For-Drag--Drop-Cut-Copy-and-Paste.htm [ ^ ]
First of all, read this: The Drag and Drop interface samples[^] and see this: http://msdn.microsoft.com/en-us/vstudio/bb905826.aspx[^]

More you''ll find at:
http://www.tenouk.com/visualcplusmfc/visualcplusmfc25a.html[^]
http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c4145/Using-MFC-For-Drag--Drop-Cut-Copy-and-Paste.htm[^]


这篇关于如何将文件从文件夹拖放到MFC C ++ VS2010中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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