AlexandruC
AlexandruC

Reputation: 3637

VS 2008 resource type error while changing language

While changing the language of the resource elements in my visual studio project from english to azerbaijan I am getting this error:

error RC2144 : PRIMARY LANGUAGE ID not a number

and that line is :

LANGUAGE LANG_AZERI_CYRILLIC, SUBLANG_AZERI_CYRILLIC

What's happening here?

// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include <windows.h>
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#ifndef APSTUDIO_INVOKED
#include "targetver.h"
#endif
#include "winres.h"

Upvotes: 2

Views: 3446

Answers (4)

Mike Weir
Mike Weir

Reputation: 3189

Simply add #include <windows.h> to your resources.rc file. Sometimes the line is not generated.

It's lame, I know.

Upvotes: 2

Gottfried
Gottfried

Reputation: 19

With Visual Studio 2015 These lines always been overwritten when editing resources. To add this includes with Visual Studio 2015:

  1. Go to "Resource View" Ctrl+Shift+E
  2. Right click on the resource.rc file and select resourceincludes
  3. Add to the write protected symbols:

    #include "winres.h"

Upvotes: 1

dns
dns

Reputation: 2815

The error is because the resource designer using constant (language ID) defined in winres.h, but the winres.h is not included in the resource file.

Add this line to resource.rc (view code as text, not from dialog editor), this will fix the problem:

#define APSTUDIO_READONLY_SYMBOLS
#include <winres.h>
#undef APSTUDIO_READONLY_SYMBOLS

P.S: you need also to define APSTUDIO_READONLY_SYMBOLS to keep include winres.h because Visual Studio will always keep removing #include

Upvotes: 7

AlexandruC
AlexandruC

Reputation: 3637

The solution was to change the line LANGUAGE LANG_AZERI_CYRILLIC, SUBLANG_AZERI_CYRILLIC from the resource file to LANGUAGE LANG_AZERI, SUBLANG_AZERI_CYRILLIC as defined here. It seems like visual studio generated that code erroneously.

Upvotes: 0

Related Questions