Steve W.
2005-02-16 20:12:48 UTC
I'm hoping that someone has seen this before - or has some idea of what I'm talking about...
I've come accross a situation in which I am walking the list items in the standard File Dialog's list control.
The filenames of each file is retrieved as a multibyte string, and then fed to ::GetFileAttributesA(full_path),
which is always returning INVALID_FILE_ATTRIBUTES for filenames that are actually in non-Western characters.
This algorithm works for any western based language. But when fed a multibyte string, both on my machine set to
have non-unicode programs run as Japanese software, and on our OEM's true Japanese boxes, ::GetFileAtttributes()
return INVALID_FILE_ATTRIBUTES (DWORD -1).
The entire 250,000+ line application isn't about to be turned into UNICODE any day soon.
I'm at a bit of a loss. I need to be able to determine the attributes of each file.
Changing our code so that calls ::GetFileAttributesW(widename) means that we suddenly must use Microsoft Layer for
Unicode support in order to run on pre 2000 boxes. This is... an unfortunate requirement. Also, what happens
under 98 where the filenames are not in UNICDE in the list control? They're actually in Ascii - yet the OS seems to
allow for Kanji based filenames.
Any thoughts? Ideas of what I might look into?
---
Related: Any ideas of where I could look to create my own custom File Open / Save As control / dialog? Subclassing
the common dialog from Microsoft is coming up against more and more of these "grey" areas that are giving me
sleepless nights. Does anyone know of a good example or library that shows exactly how to browse the filesystem
without the common dialogs? I would need to be able to browse everywhere, display icons, etc., much like the
standard dialog does. I'd just like to have complete access to all of the inner workings of such a dialog / interface.
Thanks for any advice you may have.
I've come accross a situation in which I am walking the list items in the standard File Dialog's list control.
The filenames of each file is retrieved as a multibyte string, and then fed to ::GetFileAttributesA(full_path),
which is always returning INVALID_FILE_ATTRIBUTES for filenames that are actually in non-Western characters.
This algorithm works for any western based language. But when fed a multibyte string, both on my machine set to
have non-unicode programs run as Japanese software, and on our OEM's true Japanese boxes, ::GetFileAtttributes()
return INVALID_FILE_ATTRIBUTES (DWORD -1).
The entire 250,000+ line application isn't about to be turned into UNICODE any day soon.
I'm at a bit of a loss. I need to be able to determine the attributes of each file.
Changing our code so that calls ::GetFileAttributesW(widename) means that we suddenly must use Microsoft Layer for
Unicode support in order to run on pre 2000 boxes. This is... an unfortunate requirement. Also, what happens
under 98 where the filenames are not in UNICDE in the list control? They're actually in Ascii - yet the OS seems to
allow for Kanji based filenames.
Any thoughts? Ideas of what I might look into?
---
Related: Any ideas of where I could look to create my own custom File Open / Save As control / dialog? Subclassing
the common dialog from Microsoft is coming up against more and more of these "grey" areas that are giving me
sleepless nights. Does anyone know of a good example or library that shows exactly how to browse the filesystem
without the common dialogs? I would need to be able to browse everywhere, display icons, etc., much like the
standard dialog does. I'd just like to have complete access to all of the inner workings of such a dialog / interface.
Thanks for any advice you may have.