如何在运行时使用C ++选择和打开文件?

时间:2013-03-04 13:35:32

标签: c++ textures openfiledialog

目前我正在为Textures创建一个Editor,我想在运行时选择纹理。后来我想为新纹理选择保存目录。

我找到了 How to: Open Files Using the OpenFileDialog Component。但我认为这不是解决方案。 OpenFileDialog

3 个答案:

答案 0 :(得分:0)

(假设你在Windows上,按截图显示) 如果您只想选择一个文件夹,可以使用SHBrowseForFolder。

http://msdn.microsoft.com/en-us/library/windows/desktop/bb762115%28v=vs.85%29.aspx

微米。

答案 1 :(得分:0)

您需要查看通用对话库。

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645524(v=vs.85).aspx

或者,如果您只对Vista / Windows 7支持感兴趣,可以考虑使用Common Item Dialog。

http://msdn.microsoft.com/en-gb/library/windows/desktop/bb776913(v=vs.85).aspx

对于“原生”C ++,您将无法轻松使用链接所指的.NET组件。

答案 2 :(得分:0)

我使用dirent.h文件解决了我的问题。我已通过撰写此帖How can I get the list of files in a directory using C or C++?

来确认此文件

我使用dirent.h和SFML编写了自己的fileexplorer。

很抱歉,如果我无法说明我的问题。

但感谢回复(:

相关问题