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. OpenDialog

OpenDialog

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
6 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.
  • C Offline
    C Offline
    Chandrasekharan P
    wrote on last edited by
    #1

    How do i restrict the user to go to one particular directory if the browse button is clicked? its an mfc application

    N S 2 Replies Last reply
    0
    • C Chandrasekharan P

      How do i restrict the user to go to one particular directory if the browse button is clicked? its an mfc application

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      Try CDN_INCLUDEITEM Notification[^]

      nave [OpenedFileFinder] [My Blog]

      C 1 Reply Last reply
      0
      • N Naveen

        Try CDN_INCLUDEITEM Notification[^]

        nave [OpenedFileFinder] [My Blog]

        C Offline
        C Offline
        Chandrasekharan P
        wrote on last edited by
        #3

        i am getting the complete path name using the GetPathName(). now say i get something like this. c:\\program files\\my folder\\1.c now i want to extract only "c:\\program files" this looks really simple.. but i need some help.

        N 1 Reply Last reply
        0
        • C Chandrasekharan P

          i am getting the complete path name using the GetPathName(). now say i get something like this. c:\\program files\\my folder\\1.c now i want to extract only "c:\\program files" this looks really simple.. but i need some help.

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          what is the condition to decide "c:\\program files" is the needed directory ? The first folder after the drive letter? If so passing the above string to PathRemoveFileSpec() for two time will return "c:\\program files".

          nave [OpenedFileFinder] [My Blog]

          C 1 Reply Last reply
          0
          • N Naveen

            what is the condition to decide "c:\\program files" is the needed directory ? The first folder after the drive letter? If so passing the above string to PathRemoveFileSpec() for two time will return "c:\\program files".

            nave [OpenedFileFinder] [My Blog]

            C Offline
            C Offline
            Chandrasekharan P
            wrote on last edited by
            #5

            that was just an example.. its so programmed that the data will be available in the 1st level.

            1 Reply Last reply
            0
            • C Chandrasekharan P

              How do i restrict the user to go to one particular directory if the browse button is clicked? its an mfc application

              S Offline
              S Offline
              Sandeep Saini SRE
              wrote on last edited by
              #6

              Here it is -

              CFileDialog dlg(TRUE);
              CString sPath = "c:\\program files\\my folder\\1.c";
              int nPos = sPath.Find("\\");
              nPos = sPath.Find("\\",nPos + 1);
              sPath = sPath.Left(nPos + 1);
              dlg.m_ofn.lpstrInitialDir = sPath;
              dlg.DoModal();

              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