Solved

visual c++ file browser

Posted on 2001-09-04
3
917 Views
Last Modified: 2008-03-04
Dear all,

   Do you know how to write a simple file browser using Visual C++?Thanks!
0
Comment
Question by:hpchong7
3 Comments
 
LVL 1

Expert Comment

by:hide_in
ID: 6452555
if you use MFC, you can use CFileDialog. if using SDK,
you can you GetOpenFileName() API,but it's more complex tan using CFileDialog
0
 

Accepted Solution

by:
ValiH earned 30 total points
ID: 6460036
 Here is a pice of code you can use. I have tried to keep it as simple as posible so if you want something more, plese let me now. Also let me now if it does (does not) work.

CString pathname;

  CFileDialog f_browser(true,NULL,NULL);
   if (f_browser.DoModal()==IDOK)
     {
         pathname=f_browser.GetPathName();
     }
     

0
 
LVL 2

Author Comment

by:hpchong7
ID: 6472983
Dear ValiH,

   I still have no time to try it.But I trust you.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now