Someone forgot the LCID? :-)

by Michael S. Kaplan, published on 2006/09/26 03:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/09/26/771713.aspx


Shell developer Ben Karas has been posting about the property system in the Shell in his new blog The Great Flying Tortoise, and one post in particular caught my eye, the one entitled PROPVARIANT Helpers #6 - PropVariantCompare[Ex].

The function actually has one of those possible situations that drives people who are building indexes crazy, that case where A < B and also B < A. Though thankfully this has more to do with the fact that variants are being compared and thus they are always compared in the context of the first item -- meaning that comparing A to B will use A's type, while comparing B to A will use B's type. And thus what in the world of CompareString and LCMapString is a bug that someone on the SQL Server team is justifiably unhappy about, can become an understandable issue that is not really going to be fatal....

As Ben mentioned, the RTM version of PropVariantCompareEx, while not containing an LCID (or locale name) parameter, will at least contain some flag values to control whether string comparsions are done with StrCmpLogicalW (the default), or the other Shell comparison functions like StrCmp, StrCmpC, StrCmpI, or StrCmpIC. Looking at the flag values (which have not been published yet) they currently appear to literally be flag values using different bits (when obviously you would never really be able to reasonably combine them).

I'll wait for PropVariantCompareEx2 that takes an LCID, or even better takes a locale name. :-)

In the meantime, Ben's blog is definitely one worth keeping an eye on, so I have added it to the blogs I read....

 

This post brought to you by (U+a442, a.k.a. YI SYLLABLE NJURX)


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day