?
Solved

MFC Browse Button

Posted on 2010-01-05
8
Medium Priority
?
830 Views
Last Modified: 2013-12-14
Does anyone know a simple way to do an MFC Browse button?  Looking for the simplest solution.

The browse button needs to populate a text box next to the button.

help much appreciated.
Using Visual Studio 2008.
0
Comment
Question by:lcor
8 Comments
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 26183461
What is this MFC Browse button?
An edit box and a button, the button calls the open file dialog?
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 26183489
Browse for what ?
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 200 total points
ID: 26184233
Latest version of MFC has one that does it automatically:
MFC Feature Pack for VS 2008 and 2010
http://www.experts-exchange.com/A_2128.html
CMFCEditBrowseCtrl
http://msdn.microsoft.com/en-us/library/bb983421.aspx 
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Assisted Solution

by:Pramod Bugudai
Pramod Bugudai earned 200 total points
ID: 26188037
What I think is, you are asking for browse for open file dialog(file browser dialog) when a button name browse is clicked. And what you select from the browser dialog it should return the path of file or folder in the text box. If this is the case than follow the link.

http://www.codeproject.com/file/browsepf.asp
0
 

Author Comment

by:lcor
ID: 26193575
yes, browse for a file...
0
 
LVL 8

Expert Comment

by:Pramod Bugudai
ID: 26197552
Than wats the problem? Go ahead what is said.

cheers
0
 
LVL 19

Accepted Solution

by:
alb66 earned 1600 total points
ID: 26198396
You can do the following:
void CYourDlg::OnBnClickedBrowse()
{
	CFileDialog dlg( TRUE );
	
	if ( dlg.DoModal() == IDOK )
	{
		m_strYourEditVariable = dlg.GetPathName();
		UpdateData( FALSE );
	}
}

Open in new window

0
 

Author Closing Comment

by:lcor
ID: 31673100
used alb66's solution but found the other 2 solutions informative so gave points
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question