Question

I've been puzzling over this for quite a while, and as of yet I haven't managed to find a suitable rationale.

The Win32 API provides a function for "logical string comparison" for which the prototype is:

StrCmpLogicalW( _In_ PCWSTR psz1, _In_ PCWSTR psz2 );

This function then uses digits as numbers rather than as plain text and thus provides a more 'logical' comparison of two strings.

However, most functions in the Win32 API seem to be typedef'd to use with either Multibyte or Unicode strings, for instance SendMessage is a macro which expands into SendMessageW for Unicode or SendMessageA for ANSI encodings (depending on which macro switch is enabled), so why does this function only have a wide-string version? I've searched the internet, but have been unable to find anything that explains this, so I'd be grateful if anyone can enlighten me.

Thanks in advance!

Était-ce utile?

La solution

The documentation says "Behavior of this function, and therefore the results it returns, can change from release to release. It should not be used for canonical sorting applications." so it does not seem meant for general usage.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top