New in Vista: What's your name? Who's your daddy?

Sorting it all Out
Michael Kaplan's random stuff of dubious value
Be sure to read the disclaimer here first!

New in Vista: What's your name? Who's your daddy?

  • Comments 14

It is probable bordering on certainty that the Zombies were not singing about cultures in the .NET Framework in their song Time of the Season. Even in some kind of prophetic sense.

And while I'm sure there are parents out there who may not be keen on the resource model that the .NET Framework uses (i.e. if resources do not exist for a particular language, check what its parents have!), the resource fallback model has some important customization abilities over simple string parsing of RFC-1766 or RFE-3066 names.

But this post is not about any of that. This post is about Windows.

I mean, it is easy to claim in the .NET Framework that CultureInfo names are where it is at, and that LCIDs are just there for backwards compatibility.

But meanwhile back in Windows, the NLS API and all of its functions pivot on LCID.

Well, they used to, I mean.

Because Windows Vista supports new functions that take locale names rather than LCIDs!

For now, I'll just list a bunch of the ones that are on the MSDN site online:

And more!

And of course there is the easy moving between names and LCIDs with LCIDToLocaleName and LocaleNameToLCID.

Future posts will talk about various details of many of these new functions and the special things that some of them can do that go above and beyond their LCID-based versions.

And just so you don't think the post title was entirely gratuitous:

  • There is an LCTYPE added for LOCALE_SNAME that will return the name of the locale, and
  • There is also an LCTYPE added for LOCALE_SPARENT that will return the parent name of a locale (its value is 0x0000006d and it is coming soon to a winnls.h near you!).

So now any developer running Vista can ask of a locale those immortal questions first asked by The Zombies -- What's your name? Who's your daddy?

And parents throughout the world will shudder at the precedent since those often neutral names that are the parents can be used for resource fallback, along with the new MUI functions for UI language that I will talk about another day..... :-)

 

This post brought to you by "𝅘𝅥" (U+1d15f, a.k.a. MUSICAL SYMBOL QUARTER NOTE)

Comment on the blather
Leave a Comment
  • Please add 5 and 3 and type the answer here:
  • Post
Blog - Comment List
  • Well, now we know what comes after the "Ex" version of an API. It's the "ExEx" version! EnumCalendarInfoExEx() (I'm not complaining, but I think a lot of people saw this coming)
  • In another 10 years, after two more revs of the OS, are we going to have FoobarExExExEx APIs? ;)
  • I hope not, Mike!
  • Ssssshh, don't tell anyone some of the alternative names we threw around before deciding. :)
  • That ExEx thing is horrible, come on you guys can do better than that.
  • Seriously, can you guys PLEASE not use ExEx?  It's hard to read, unprofessional, and not scalable at all.

    Plus, it is inconsistent with other APIs.  For example, IE 7 is introducing a function CreateURLMonikerEx2 (http://msdn.microsoft.com/workshop/networking/moniker/reference/functions/createurlmonikerex2.asp?frame=true).  Can you please use Ex2 (EnumCalendarInfoEx2) instead?  Please say it isn't too late to make this change.  Make it now, before Vista is released, otherwise it will be too late and it will be around forever.
  • Hi PatriotB,

    I'm sorry to say, but what IE7 here is not really a guideline for the Win32 API (nor is MLang for that matter). But punishing anyone who has started working to use the new functions is not really a good answer either....
  • :(  Just thought I'd offer my two cents on how to make the Windows API set the best it can be.

    Plus, anyone using the new functions should be under the understanding that they are "preliminary and subject to change."  You could even define the ExEx version as a macro for these users.
  • Looking at other Win32 API functions, I do not see a strong precedent of the number suffix mechanism (which seems more common in COM-based implementations). There is a wide range of possibilities (including the huge number of weird things that GDI does for the text extent functions), though....

    I am having trouble seeing what precisely is so bad about the ExEx for tha few functions that already had Ex versions, though. Could you explainI am not sure I see it as particuloar hard to read or as particularly unprofessional.

    I mean beyond the reminder of my ex, that is. :-)

    Seriously, could you give me a little more of your thinking on this?
  • the best school ever
  • Picture a Friends episode - the one entitled The One With The Morning After. Chandler, Monica, Joey,...
  • Some may remember when I asked the question Why doesn't GetDateFormat take a CALID? Some will recall

  • You may have seen the first part of this series ( A way better model for features ). Think of this as

  • Regular readers might recall a long ago blog entitled New in Vista: What's your name? Who's your daddy?

Page 1 of 1 (14 items)