AssocQueryString (ANSI version) does not work in XP or Vista

This is going back awhile but colleague and I had a hell of a time recently trying to solve a problem where the Windows API method “AssocQueryString” did not seem to work in XP.

After creating a test application in various different configurations and testing it on several platforms we found that the ANSI version of AssocQueryString just did not work.

It was not until this evidence came to light that we finally found a connect article (in the depths of my browser history) describing this issue.

Our codebase might be quite rare (it is still currently 100% ANSI) and I would expect many to already be using Unicode… the workaround was to use it in Unicode and use conversions to interact with the rest of the codebase.

So yeah… hopefully others might find this elightening and save hours of hair pulling.

Leave a Reply