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. GetModuleFileName and case sensitivity

GetModuleFileName and case sensitivity

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelp
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.
  • V Offline
    V Offline
    vikramlinux
    wrote on last edited by
    #1

    Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.

    _ S 2 Replies Last reply
    0
    • V vikramlinux

      Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Here is an excerpt from the documentation for GetModuleFileName - The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". So the output will depend on how your EXE was loaded.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++) (October 2009 - September 2013)

      Polymorphism in C

      V 1 Reply Last reply
      0
      • _ _Superman_

        Here is an excerpt from the documentation for GetModuleFileName - The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". So the output will depend on how your EXE was loaded.

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++) (October 2009 - September 2013)

        Polymorphism in C

        V Offline
        V Offline
        vikramlinux
        wrote on last edited by
        #3

        "So the output will depend on how your EXE was loaded." Can you please help in elaborating it more?

        V 1 Reply Last reply
        0
        • V vikramlinux

          "So the output will depend on how your EXE was loaded." Can you please help in elaborating it more?

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

          To add more context, we are using CreateProcess(...) API to launch the exe file. However, even though the code is same but GetModuleFileName returns me different output.

          L 1 Reply Last reply
          0
          • V vikramlinux

            Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.

            S Offline
            S Offline
            SajeeshCheviry
            wrote on last edited by
            #5

            Vikrams..pls read it http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx. I think this may be the reason. :)

            V 1 Reply Last reply
            0
            • V vikramlinux

              To add more context, we are using CreateProcess(...) API to launch the exe file. However, even though the code is same but GetModuleFileName returns me different output.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              It would be better if you explained what problem this is causing you. The character case of an executable filename is not significant in Windows. If you want to read the full documentation it is at http://msdn.microsoft.com/en-us/library/windows/desktop/ms683197(v=vs.85).aspx[^].

              Use the best guess

              1 Reply Last reply
              0
              • S SajeeshCheviry

                Vikrams..pls read it http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx. I think this may be the reason. :)

                V Offline
                V Offline
                vikramlinux
                wrote on last edited by
                #7

                I went though it, but able to get the reason.

                L 1 Reply Last reply
                0
                • V vikramlinux

                  I went though it, but able to get the reason.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  And you still have not explained what your problem is.

                  Use the best guess

                  V 1 Reply Last reply
                  0
                  • L Lost User

                    And you still have not explained what your problem is.

                    Use the best guess

                    V Offline
                    V Offline
                    vikramlinux
                    wrote on last edited by
                    #9

                    I would like to know if this particular API has any known issues.

                    L 1 Reply Last reply
                    0
                    • V vikramlinux

                      I would like to know if this particular API has any known issues.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Then you should read the documentation and Google for other questions.

                      Use the best guess

                      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