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. Getting the Current Application Path

Getting the Current Application Path

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
5 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.
  • H Offline
    H Offline
    harinat
    wrote on last edited by
    #1

    Hello Guys I need some help regarding VC++, during the Application runtime..how can the get the Application Path ..i.e the Folder path from where the App runs Thanks in Advance Hariharan.S.N

    A V M 3 Replies Last reply
    0
    • H harinat

      Hello Guys I need some help regarding VC++, during the Application runtime..how can the get the Application Path ..i.e the Folder path from where the App runs Thanks in Advance Hariharan.S.N

      A Offline
      A Offline
      Antti Keskinen
      wrote on last edited by
      #2

      Get the application object with AfxGetApp. The CWinApp::m_pszExeName member contains the path and name of the executable without the .EXE extension. After getting this string, just manipulate it to remove the application's name (Remove characters until last character before NULL is '\'). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      D 1 Reply Last reply
      0
      • A Antti Keskinen

        Get the application object with AfxGetApp. The CWinApp::m_pszExeName member contains the path and name of the executable without the .EXE extension. After getting this string, just manipulate it to remove the application's name (Remove characters until last character before NULL is '\'). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

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

        Antti Keskinen wrote: After getting this string, just manipulate it to remove the application's name (Remove characters until last character before NULL is '\'). Or use _splitpath().


        Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

        1 Reply Last reply
        0
        • H harinat

          Hello Guys I need some help regarding VC++, during the Application runtime..how can the get the Application Path ..i.e the Folder path from where the App runs Thanks in Advance Hariharan.S.N

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          One solution is GetModuleFileName(). Kuphryn

          1 Reply Last reply
          0
          • H harinat

            Hello Guys I need some help regarding VC++, during the Application runtime..how can the get the Application Path ..i.e the Folder path from where the App runs Thanks in Advance Hariharan.S.N

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            See the FAQ 8.3 How do I find the full path to my program's EXE file?[^] --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Laugh it up, fuzzball.

            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