C2664 compilation error by using typedef enum in a idl file
- From: Torsten <Torsten@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Aug 2008 03:49:00 -0700
Hello!
I am migrating a VS6 project to VS2005. The project compiles and runs by
using VC6. By using VS2005 the compilation fails.
I found a question about the same problem but without any answer. So I am
using the example from this question:
FOO.IDL contains:
interface IPoint : IUnknown
{
typedef [v1_enum, public] enum _units
{
millimeters = 0,
inches,
points
} _units_t;
[propget, helpstring("property dX")] HRESULT dX([in] _units_t dimUnits,
[out, retval] double* pVal);
[propget, helpstring("property dY")] HRESULT dY([in] _units_t dimUnits,
[out, retval] double* pVal);
}
STDAFX.CPP contains:
STDAFX.H contains:
FOOBUG.CPP contains:
void FooBar( foo::IPointPtr pPoint )
{
double dXInches = pPoint->dX[inches]; // Get X value using inch units
double dYInches = pPoint->dY[inches];
}
FOOBUG.CPP now fails to compile with the following error messages:
FOOBUG.CPP(5) : error C2664: 'foo::IPoint::GetdX' : cannot convert parameter
1 from '_units' to foo::_units_t'
In the same idl file I defined some interfaces as well. But I don't have any
problems with those.
At the beginning I thought it is a very common problem but it doesn't seem so.
Does anybody know what the problem is?
Warm regards
Torsten
.
- Prev by Date: Re: static_cast interface pointer to implementation class
- Next by Date: Re: ATL Com Service client CoCreateInstance call returns 0x8007000
- Previous by thread: static_cast interface pointer to implementation class
- Next by thread: Re: C2664 compilation error by using typedef enum in a idl file
- Index(es):