FindFirstFile returning wildcards?
-
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
-
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
Are you using the Unicode version of FindFirstFile..?
-- If not entertaining, write your congressman
-
Are you using the Unicode version of FindFirstFile..?
-- If not entertaining, write your congressman
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? -
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?skullfire wrote:
Any ideas?
No, sorry. :(
-- Simulcast on Crazy People's Fillings
-
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?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 withL"*.*"
, unless you are using the TEXT macro like:skullfire wrote:
if (strPattern.Right(1) != TEXT("\\") )