Buying the cow vs. the cut of beef you like

by Michael S. Kaplan, published on 2009/07/07 10:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2009/07/07/9822548.aspx


The other day a question came from someone doing some work to support MUI in their application. Their question was simple enough:

Which one is preferred way GetFileMUIPath VS. GetThreadPreferredUILanguages?

Although the question seems simple, the answer is even simpler.

This is the wrong question.

These two functions have two different though related purposes:

GetFileMUIPath is best thought of as a Windows-specific implementation of the resource logic -- it assumes that even if you are not built into Windows that you are following the same rules about directories and resources as if you were. And it returns information that your application may or may not even need, depending.

Now obviously GetFileMUIPath works at a much higher level than GetThreadPreferredUILanguages -- in fact, GetFileMUIPath even takes a flag value that instructs the function to make use of the samje list provided by GetThreadPreferredUILanguages (MUI_USE_PREFERRED_UI_LANGAUGES).

If you do anything even remotely different in how you have laid out the files or whatever then you have to do that extra work yourself, possibly based on the list provided by GetThreadPreferredUILanguages. Or not -- it is really up to you -- entirely based on how your app's resources work.

So asking which one to use is kind of the equivalent of asking something like:

Which is the preferred way -- buy the live cow, or the top round sirloin cut?

(A particularly relevant metaphor given the way the MUI (EHM-YOU-EYE) team calls themselves the MUI (MOO-EEY) team -- cows mooing seems within their expected results!)

Of course there is no best answer here either, except based on the situation.

Perhaps you lack the facilities to slaughter the cow. Or perhaps you preferred the ribeye. Maybe you are a vegetarian and need to make alternate plans for dinner.

But asking which one is "preferred" under those circumstances makes no sense....


Mihai on 9 Jul 2009 1:21 PM:

In fact the best use of GetFileMUIPath is for non-resources.

The Windows loader will take care of the resource part, but applications should use GetFileMUIPath for other localizable elements.

(ie help, samples, clipart, templates, read-me, license, ...)

Mihai on 9 Jul 2009 1:24 PM:

I initially thought that the connection with the cow is that the answer to the question is "Mu"

(http://en.wikipedia.org/wiki/Mu_%28negative%29)


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