Re: C2664 compilation error by using typedef enum in a idl file
- From: "SvenC" <SvenC@xxxxxxxxxxxxx>
- Date: Thu, 7 Aug 2008 12:55:44 +0200
Hi Torsten,
thank you for your suggestioin. I changed the code. So now it looks
like: [v1_enum] enum _units_t
You should avoid identifiers starting with an underscore as those
are reserved for the compiler vendors. You are asking for a naming
collision here.
{
millimeters = 0,
inches,
points
};
Unfortunatly the compile error didn't changed. I skiped the [v1_enum]
as well, just in case, but the error was still the same.
Strange, I use them quite often. With the v1_enum that ensures that a 32 bit
data type is used.
Did you put the enum outside any other block, even outside the library block?
You started to use it inside of an interface. I would put it outside of any other
block. If you need it included in the library block just use a forward declaration
in that block:
library whatEverLib
{
enum units_t;
}
Additionally I found several examples like
typedef [v1_enum] enum tagUI_MESSAGE_TYPE
{
UI_MESSAGE_ERROR = 0x00000000,
UI_MESSAGE_WARNING = 0x00000001,
UI_MESSAGE_UNKNOWN = 0x00000002,
} UI_MESSAGE_TYPE;
(see http://support.microsoft.com/kb/907229/de) for instance.
Looks like that C style usage is not your problem
Is it possible that it is a bug? I am using Visual Studio 2005 Version
8.0.50727.762 (SP 050727-7600). I could not find anything on the
internet about that.
I switched to VC9 a while ago but hat no problems with VC8 on my
enum types. So I guess it is not a bug or a rare condition you run into
You could try to create a minimal sample by creating a simple ATL
project with one ATL simple object and then add your enum to that
idl and see how it goes.
--
SvenC
.
- References:
- Prev by Date: Re: C2664 compilation error by using typedef enum in a idl file
- Next by Date: dependent name is not a type prefix with 'typename' to indicate a type
- Previous by thread: Re: C2664 compilation error by using typedef enum in a idl file
- Next by thread: Re: ATL Com Service client CoCreateInstance call returns 0x8007000
- Index(es):
Relevant Pages
|