Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. File browser control in MFC

File browser control in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 4396598
    wrote on last edited by
    #1

    Is there any file browser control in MFC? my requirement is, the application should allow the user to browse a file, based on the user selection i should get the selected file name and the corresponding file path to do some operations on that file. please provide the solution for this problem, thanks in advance Regards, Anil

    hi

    J R 2 Replies Last reply
    0
    • U User 4396598

      Is there any file browser control in MFC? my requirement is, the application should allow the user to browse a file, based on the user selection i should get the selected file name and the corresponding file path to do some operations on that file. please provide the solution for this problem, thanks in advance Regards, Anil

      hi

      J Offline
      J Offline
      Joseph Marzbani
      wrote on last edited by
      #2

      Why don't you just use CFileDialog class?

      Thank you masters!

      1 Reply Last reply
      0
      • U User 4396598

        Is there any file browser control in MFC? my requirement is, the application should allow the user to browse a file, based on the user selection i should get the selected file name and the corresponding file path to do some operations on that file. please provide the solution for this problem, thanks in advance Regards, Anil

        hi

        R Offline
        R Offline
        rp_suman
        wrote on last edited by
        #3

        A sample code to select Text/CSV file here:

        CFileDialog l_SampleDlg(TRUE,NULL,NULL,OFN_OVERWRITEPROMPT,"Text Files (*.txt)|*.txt|Comma Separated Values(*.csv)|*.csv||");
        int iRet = l_SampleDlg.DoModal();
        CString l_strFileName;
        l_strFileName = l_SampleDlg.GetPathName();

          if(iRet == IDOK)
              MessageBox(l\_strFileName);
          else
              MessageBox("No File Selected!");
        

        -- "Programming is an art that fights back!"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups