What does "inappropriate modifiers for non-VIRTKEY" error means in windres?

94 Views Asked by At

I'm trying to port an application written years ago in Borland C++ 5.0 to be able to compile with MinGW.

I sorted out most of the problems but I have problems with one RC file:

Windres complains for these entries in the following accelerator table:

menu ACCELERATORS
{
    VK_DELETE,     CM_KILL_YOUR_UNIT, VIRTKEY
    ".",            CM_FOLLOWMODE, ASCII
    VK_TAB,        CM_IDLEGATHERSHIP, VIRTKEY
    "s",            CM_STOP, ASCII
    "T",            CM_TRIBUTE, ASCII, CONTROL
    "f",            CM_FLUENTTRAINING, ASCII
    "k",            CM_NEXTUNIT, ASCII
    VK_F10,        CM_FOLLOWSTRONGEST, VIRTKEY, CONTROL
}

(I stripped out the entries it doesn't complain to.)

The error is: inappropriate modifiers for non-VIRTKEY

I don't know what to do to fix this. One results Google have come up for this error is the source code dumps and patches in the windres itself.

Any ideas?

1

There are 1 best solutions below

0
On

I found it out... The problem isn't in the lines windres complain to, but one line above them.

More specifically:

"F",            CM_FRIENDORFOECOLORS, ASCII, CONTROL
"S",            CM_SAVEGAME, ASCII, CONTROL
"C",            CM_CHANGEPLAYER, ASCII, CONTROL
"L",            CM_LOADGAME, ASCII, CONTROL
"B",            CM_BGM, ASCII, CONTROL
"A",            CM_STATSWND, ASCII, CONTROL
"E",            CM_FXSOUND, ASCII, CONTROL

Apparently it's not valid to add modifiers to the ASCII accelerators.

MSDN also says:

An integer value representing a virtual key. The virtual key for alphanumeric keys can be specified by placing the uppercase letter or number in double quotation marks (for example, "9" or "C"). The type parameter must be VIRTKEY.

So probably simply changing the type to VIRTKEY should fix the problem. (I will try it out once I get home...)