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. FindFirstFile returning wildcards?

FindFirstFile returning wildcards?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
5 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.
  • S Offline
    S Offline
    skullfire
    wrote on last edited by
    #1

    Well, in the software i'm developing, we need to display images on a folder. I'm using the FindFirstFile function and specifying a directory. This is working fine. The problem arises when there's a filename that contains extended characters, such as "U+FB98: Arabic Letter Gueh Initial Form", which is this one: ﮘ. Now, the FindFirstFile function returns it, but the FindFileData.cFileName returns a filename with some question marks(I suppose these are wildcards) instead of the symbols. This would not be a problem if the loading CBitmap would work... but it doesnt. I suppose it's in fact because of these symbols being replaced with question marks. Is there any way around this? How can I effectively get the filename I need? Is this a problem with gdiplus CBitmap loading operation or with the filename being given with question marks? Thanks in advance! Andrés Cartín

    J 1 Reply Last reply
    0
    • S skullfire

      Well, in the software i'm developing, we need to display images on a folder. I'm using the FindFirstFile function and specifying a directory. This is working fine. The problem arises when there's a filename that contains extended characters, such as "U+FB98: Arabic Letter Gueh Initial Form", which is this one: ﮘ. Now, the FindFirstFile function returns it, but the FindFileData.cFileName returns a filename with some question marks(I suppose these are wildcards) instead of the symbols. This would not be a problem if the loading CBitmap would work... but it doesnt. I suppose it's in fact because of these symbols being replaced with question marks. Is there any way around this? How can I effectively get the filename I need? Is this a problem with gdiplus CBitmap loading operation or with the filename being given with question marks? Thanks in advance! Andrés Cartín

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      Are you using the Unicode version of FindFirstFile..?

      -- If not entertaining, write your congressman

      S 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        Are you using the Unicode version of FindFirstFile..?

        -- If not entertaining, write your congressman

        S Offline
        S Offline
        skullfire
        wrote on last edited by
        #3

        Well, I tried to. I have to prefix this "\\?\" to the path right? In C the prefix would be written as "\\\\?\\". This produces the exact same results. strPattern = "\\\\?\\" + m_folder; if (strPattern.Right(1) != TEXT("\\") ) strPattern += "\\"; strPattern += "*.*"; hFind = ::FindFirstFile(strPattern, &FindFileData); // start search Any ideas?

        J F 2 Replies Last reply
        0
        • S skullfire

          Well, I tried to. I have to prefix this "\\?\" to the path right? In C the prefix would be written as "\\\\?\\". This produces the exact same results. strPattern = "\\\\?\\" + m_folder; if (strPattern.Right(1) != TEXT("\\") ) strPattern += "\\"; strPattern += "*.*"; hFind = ::FindFirstFile(strPattern, &FindFileData); // start search Any ideas?

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          skullfire wrote:

          Any ideas?

          No, sorry. :(

          -- Simulcast on Crazy People's Fillings

          1 Reply Last reply
          0
          • S skullfire

            Well, I tried to. I have to prefix this "\\?\" to the path right? In C the prefix would be written as "\\\\?\\". This produces the exact same results. strPattern = "\\\\?\\" + m_folder; if (strPattern.Right(1) != TEXT("\\") ) strPattern += "\\"; strPattern += "*.*"; hFind = ::FindFirstFile(strPattern, &FindFileData); // start search Any ideas?

            F Offline
            F Offline
            fefe wyx
            wrote on last edited by
            #5

            skullfire wrote:

            I have to prefix this "\\?\" to the path right?

            No. You do not have to add the prefix. Just go to your project settings and change your project to using UNICODE. And you have to change all string constants in your program to wide char strings, i.e., "*.*" should be replaced with L"*.*", unless you are using the TEXT macro like:

            skullfire wrote:

            if (strPattern.Right(1) != TEXT("\\") )

            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