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. Method to get file path

Method to get file path

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
8 Posts 5 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.
  • N Offline
    N Offline
    nvphap
    wrote on last edited by
    #1

    Iam using MFC .In my project,I choose "single document" .while Iam writting,I have a problem that when I choose "File" on menu ,I continue to choose Open .MFC Program display me a dialog which help choose a file .And after I choose file,I don't know how do I get file path .Please help me.Thanks Iam going to post pictures on forum,but I can't find where post it.Iam sorry

    D N 2 Replies Last reply
    0
    • N nvphap

      Iam using MFC .In my project,I choose "single document" .while Iam writting,I have a problem that when I choose "File" on menu ,I continue to choose Open .MFC Program display me a dialog which help choose a file .And after I choose file,I don't know how do I get file path .Please help me.Thanks Iam going to post pictures on forum,but I can't find where post it.Iam sorry

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      nvphap wrote:

      And after I choose file,I don't know how do I get file path .

      Your document class has methods for retrieving that.

      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      L 1 Reply Last reply
      0
      • D David Crow

        nvphap wrote:

        And after I choose file,I don't know how do I get file path .

        Your document class has methods for retrieving that.

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        DavidCrow wrote:

        Your document class has methods for retrieving that.

        Yeah, I think they still hide that information in the documentation. :-D

        led mike

        1 Reply Last reply
        0
        • N nvphap

          Iam using MFC .In my project,I choose "single document" .while Iam writting,I have a problem that when I choose "File" on menu ,I continue to choose Open .MFC Program display me a dialog which help choose a file .And after I choose file,I don't know how do I get file path .Please help me.Thanks Iam going to post pictures on forum,but I can't find where post it.Iam sorry

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

          may you speak clearly about which you reply to me,please .Thanks

          M N 2 Replies Last reply
          0
          • N nvphap

            may you speak clearly about which you reply to me,please .Thanks

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            From your document class(es), you can call CDocument::GetPathName() to get the full pathname. Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            1 Reply Last reply
            0
            • N nvphap

              may you speak clearly about which you reply to me,please .Thanks

              N Offline
              N Offline
              nvphap
              wrote on last edited by
              #6

              After I click button "open" to choose file ,the event or function where I will process to get file path,what is it's name? .Thanks

              N 1 Reply Last reply
              0
              • N nvphap

                After I click button "open" to choose file ,the event or function where I will process to get file path,what is it's name? .Thanks

                N Offline
                N Offline
                nvphap
                wrote on last edited by
                #7

                Please,Thanks

                R 1 Reply Last reply
                0
                • N nvphap

                  Please,Thanks

                  R Offline
                  R Offline
                  ramana g
                  wrote on last edited by
                  #8

                  Override the CDocument::OnOpenDocument(LPCTSTR lpszPathName) function. The arguement contains the File Name which is selected in Open dialog

                  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