开发者

MFC CFileDialog - Getting special folder path on windows 7

开发者 https://www.devze.com 2023-04-13 05:05 出处:网络
All. I have some problem during writing an mfc application. It is using the sample project, posted on below url, to implement multiple selection on CFileDialog.

All.

I have some problem during writing an mfc application. It is using the sample project, posted on below url, to implement multiple selection on CFileDialog.

http://www.codeproject.com/KB/MFC/SelectDialog.aspx

It works fine on Windows Xp but has one problem on Windows 7. The problem is that CFileDialog::GetFolderPath returns the empty string about the windows special folders such as Library/Documents on Windows 7. So I tried lik开发者_高级运维e below.

if (FileDialog.DoModal() == IDOK) {
    tFolder = FileDialog.GetPathName();
}

This functions looks fine but It doesn't work when I select the folder on dialog.

Who can help me?

Waiting your answers... Regards.


I guess the problem is that Win7 libraries do not have have a path in the file system (Actually, they are kind of an alias for a collection of paths).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号