Horrifically nasty gotcha: FindResource and FindResourceEx
FindResourceEx function is an extension of the
FindResource function in that it allows you to specify a particular language fork in which to search for the resource. Calilng the
FindResource function is equivalent to calling
FindResourceEx and passing zero as the
Except for the horrible nasty gotcha: The second and third parameters to
FindResourceEx are in the opposite order compared to the second and third parameters to
In other words, if you are adding custom language support to a program, you cannot just stick a
wLanguage parameter on the end when you switch from
FindResourceEx. You also have to flip the second and third parameters.
|You change it to||
|You should have changed it to||
The nasty part of this is that since the second and third parameters are the same type, the compiler won’t notice that you got them backward. The only way you find out is that your resource code suddenly stopped working.