4

I have a simple IDL file which contains only one enum. One of the identifiers is cy.

[
  uuid(2642345F-F2AB-3600-8926-26E823800902),
  version(1.0),
]

library MyLib
{
    typedef[ uuid(a0b0aa7b-345f-4b3a-b88f-d6cdd048e205) ]
    enum Codes
    {
       cy, 
       abc
    } Codes;
};

However, MIDL won't compile this and gives me an error like:

MIDL2025: expecting an identifier near "cy"

My first guess was that cy is a keyword/reserved word in MIDL -- but it's not.
My second guess was that either cy has already been used somewhere or is a type -- but it's not.

Any idea on what could be the issue here?

whoan
  • 8,143
  • 4
  • 39
  • 48
athena
  • 5,579
  • 8
  • 30
  • 31

2 Answers2

3

Based on some experimentation, it appears that the compiler is denying case insensitive names from WTypes.h.

For example, it will also deny these names:

byte_blob
bstr
clipdata
decimal
userbitmap
userhbitmap
remhglobal
statflag
...etc...
TheSteve
  • 1,138
  • 6
  • 12
  • But the enum in my code is in a different library (MyLib). So why should it conflict with those in Wtypes.h ? – athena Jan 15 '15 at 18:56
0

The first step is to investigate whether the is a problem specifically with cy or whether it's something else.

For a start, I'd change it to cyxyzzy or zx and see if it still complains. If so, there's probably something wrong with the structure of the name (such as being all lower case). If not, it's probably something to do with the specific cy identifier.

Another possibility is swapping around the abc and cy lines to see if the error follows the cy.

One thing you may want to consider, there are quite a few hits when searching for midl cy on the net that seem to suggest cy is aliased to a currency data type so that may be an issue.

The changes I've suggested above should hopefully confirm or deny that possibility but, at a bare minimum, they will help in deciding the scope of the problem.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953