CString变量没有显示整个文件名 [英] CString variable doesn't show me the whole filename
本文介绍了CString变量没有显示整个文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的MFC C ++项目中,我使用CFileDialog
打开文件.当我打开它时,它使打开的文件显示到EditBox中(使用SetWindowText
).
但是,当我尝试使用一个很长的文件名打开文件时,它并不能显示整个文件名-名称大约为60个字符.
我该如何避免呢?
提前谢谢!
我是这样做的:
Hi, in my MFC C++ project I use CFileDialog
to open a file. When I open it, I make it to show the opened file into EditBox (using SetWindowText
).
But when I try to open a file with a very long name, it doesn''t show me the whole file name - the name is approximately 60 characters long.
How can I avoid that?
Thanks in advance!
I do it in this way:
CFileDialog dlg(..........);
CString s = dlg.GetFileTitle();
// my edit box variable is m_path
m_path.SetWindowText(s);
如果文件名太长,则编辑框不会显示整个文件名.
If the filename is too long, the edit box doesn''t show it the whole
推荐答案
您可能会在PathCompactPath [
You might take a loog at PathCompactPath[^]
Hope that helps.
这篇关于CString变量没有显示整个文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文