Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error RC2104: undefined keyword or key name: WS_EX_LAYOUTRTL

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.

like image 432
Paul Avatar asked Oct 10 '13 13:10

Paul


1 Answers

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
like image 176
Paul Avatar answered Oct 14 '22 23:10

Paul