Click here to Skip to main content
14,983,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 28-May-10 3:29am
v3
Comments
Richard MacCutchan 27-May-10 7:20am
   
What do you mean by 'it'? Where are you trying to show the name and how?

1 solution

You might take a loog at PathCompactPath[^]

Hope that helps.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900