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. path of the application

path of the application

Scheduled Pinned Locked Moved C / C++ / MFC
c++comquestion
10 Posts 4 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.
  • R Offline
    R Offline
    radhika28
    wrote on last edited by
    #1

    I am doing an application using ATL COM application wizard.I want to get the path name of the current application .How can i get it. Thanks.

    P R 2 Replies Last reply
    0
    • R radhika28

      I am doing an application using ATL COM application wizard.I want to get the path name of the current application .How can i get it. Thanks.

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      radhika28 wrote:

      I want to get the path name of the current application

      Doesn't GetModuleFileName using _module.hInst help ?

      Prasad Notifier using ATL | Operator new[],delete[][^]

      R 1 Reply Last reply
      0
      • P prasad_som

        radhika28 wrote:

        I want to get the path name of the current application

        Doesn't GetModuleFileName using _module.hInst help ?

        Prasad Notifier using ATL | Operator new[],delete[][^]

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

        ya the above will retrive the path from exe file.But i want to retrive the path without using executable.Is it possible? Thanks.

        P D 2 Replies Last reply
        0
        • R radhika28

          I am doing an application using ATL COM application wizard.I want to get the path name of the current application .How can i get it. Thanks.

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          GetCommandLine also contains the application path.

          ~RaGE();

          I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

          R 1 Reply Last reply
          0
          • R radhika28

            ya the above will retrive the path from exe file.But i want to retrive the path without using executable.Is it possible? Thanks.

            P Offline
            P Offline
            prasad_som
            wrote on last edited by
            #5

            Do you mean folder path containing exe ? In that case why dont you trim exe name ?

            Prasad Notifier using ATL | Operator new[],delete[][^]

            R 1 Reply Last reply
            0
            • P prasad_som

              Do you mean folder path containing exe ? In that case why dont you trim exe name ?

              Prasad Notifier using ATL | Operator new[],delete[][^]

              R Offline
              R Offline
              radhika28
              wrote on last edited by
              #6

              In my ATLCOM application i am giving the executable path as C:\windows\explorer.exe.But my application is in D drive.How to retrive the path of the my application in D drive i.e D:\..... Thanks.

              P 1 Reply Last reply
              0
              • R Rage

                GetCommandLine also contains the application path.

                ~RaGE();

                I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

                R Offline
                R Offline
                radhika28
                wrote on last edited by
                #7

                This function also retrive the path of the executable file.I want to retrive the path of the current application because i gave the executable path different.Is there any function that retrives the path of the application with out using the path of executable. Thanks

                1 Reply Last reply
                0
                • R radhika28

                  ya the above will retrive the path from exe file.But i want to retrive the path without using executable.Is it possible? Thanks.

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

                  radhika28 wrote:

                  the above will retrive the path from exe file.But i want to retrive the path without using executable.

                  So use the application's handle instead of NULL as the first argument.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  P 1 Reply Last reply
                  0
                  • R radhika28

                    In my ATLCOM application i am giving the executable path as C:\windows\explorer.exe.But my application is in D drive.How to retrive the path of the my application in D drive i.e D:\..... Thanks.

                    P Offline
                    P Offline
                    prasad_som
                    wrote on last edited by
                    #9

                    Have you tried what I said earlier ? It will give path of dll. Provided you pass module instance to it. If you pass NULL as first parameter it will give exe path. From MSDN:- Parameters _hModule_ [in] Handle to the module whose file name is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file containing the current process.

                    Prasad Notifier using ATL | Operator new[],delete[][^]

                    1 Reply Last reply
                    0
                    • D David Crow

                      radhika28 wrote:

                      the above will retrive the path from exe file.But i want to retrive the path without using executable.

                      So use the application's handle instead of NULL as the first argument.


                      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                      "Judge not by the eye but by the heart." - Native American Proverb

                      P Offline
                      P Offline
                      prasad_som
                      wrote on last edited by
                      #10

                      DavidCrow wrote:

                      application's handle instead of NULL as the first argument

                      She doesn't seem to read replies carefully. I'd mention this as first reply.

                      Prasad Notifier using ATL | Operator new[],delete[][^]

                      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