Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
can any one help me to solve this
Actually the scenario is when we just have a click in the edit ctrl the path of the file has to be displayed.
Posted
Updated 30-May-17 6:27am
Comments
[no name] 24-Aug-13 6:47am    
Okay so why don't you set the edit control text to the path of the file?
P Uday kishore 5-Nov-13 4:55am    
path of what u need in edit control?????

1 solution

void CRFileDlg::OnBnClickedButton1()
{
//Just take One Edit Control and Button , Add EventHandler for button.

BROWSEINFO bi = {0};
bi.lpszTitle = _T("Browse for Folder");
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if ( pidl != NULL )
{
TCHAR tszPath[MAX_PATH] = _T("\0");
if ( SHGetPathFromIDList(pidl, tszPath) == TRUE )
{
SetDlgItemText( IDC_EDIT1, tszPath );
}

}
}
 
Share this answer
 

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