I'm designing an RTL dialog in VS 2012, and I've stumbled upon the following error:
error RC2104: undefined keyword or key name: WS_EX_LAYOUTRTL
Googling for it gave zero results, which is quite rare.
Any ideas what's the problem and how can it be solved?
Defining WS_EX_LAYOUTRTL in the .rc dialog fixes it, as well as replacing WS_EX_LAYOUTRTL with 0x00400000L, but of course these solutions don't really work as the .rc file is auto generated and the changes are lost.
The answer is: you should define the appropriate WINVER
value in your .rc file. As the .rc file is auto generated by the resource editor, you cannot just define it anywhere because it will be overwritten. You can use the TEXTINCLUDE
section to prevent it from getting overwritten.
Example (line 5):
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define WINVER 0x0500 // <-- ADDED
#include "afxres.h"
And (line 3):
2 TEXTINCLUDE
BEGIN
"#define WINVER 0x0500 // <-- ADDED\r\n"
"#include ""afxres.h""\r\n"
"\0"
END
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With