From: Emmanuel Stapf [ES] on
I had some code that looks like:

DECIMAL dec;

.... dec->scale ...

which compiled fine until I use the latest Platform SDK (v6.1) for
which I get the following error:

error C2039: 'scale' : is not a member of 'tagDEC'
C:\Program Files\Microsoft
SDKs\Windows\v6.1\Include\wtypes.h(1068) : see declaration of 'tagDEC'

What is the proper way to have this code compile fine on older version
of the wtypes.h header and the new ones?

Thanks,
Manu
From: David Lowndes on
>I had some code that looks like:
>
>DECIMAL dec;
>
>... dec->scale ...
>which compiled fine until I use the latest Platform SDK (v6.1) for
>which I get the following error:
>
>error C2039: 'scale' : is not a member of 'tagDEC'
> C:\Program Files\Microsoft
>SDKs\Windows\v6.1\Include\wtypes.h(1068) : see declaration of 'tagDEC'
>
>What is the proper way to have this code compile fine on older version
>of the wtypes.h header and the new ones?

What is the definition of struct tagDEC in the newer wtypes.h file?

Dave
From: Brian Muth on
Also, what version of VS are you using?


From: Emmanuel Stapf [ES] on
The old definition look like:

typedef struct tagDEC {
USHORT wReserved;
union {
struct {
BYTE scale;
BYTE sign;
};
USHORT signscale;
};
ULONG Hi32;
....
} DECIMAL;


The new one like:

typedef struct tagDEC {
USHORT wReserved;
union {
struct {
BYTE scale;
BYTE sign;
} DUMMYSTRUCTNAME;
USHORT signscale;
} DUMMYUNIONNAME;
ULONG Hi32;
....
} DECIMAL;

I have to compile my code using -DNONAMELESSUNION but can't recall if I
still need to do that.

Regards,
Manu


David Lowndes wrote:
>> I had some code that looks like:
>>
>> DECIMAL dec;
>>
>> ... dec->scale ...
>> which compiled fine until I use the latest Platform SDK (v6.1) for
>> which I get the following error:
>>
>> error C2039: 'scale' : is not a member of 'tagDEC'
>> C:\Program Files\Microsoft
>> SDKs\Windows\v6.1\Include\wtypes.h(1068) : see declaration of 'tagDEC'
>>
>> What is the proper way to have this code compile fine on older version
>> of the wtypes.h header and the new ones?
>
> What is the definition of struct tagDEC in the newer wtypes.h file?
>
> Dave
From: Emmanuel Stapf [ES] on
The old definition look like:

typedef struct tagDEC {
USHORT wReserved;
union {
struct {
BYTE scale;
BYTE sign;
};
USHORT signscale;
};
ULONG Hi32;
....
} DECIMAL;


The new one like:

typedef struct tagDEC {
USHORT wReserved;
union {
struct {
BYTE scale;
BYTE sign;
} DUMMYSTRUCTNAME;
USHORT signscale;
} DUMMYUNIONNAME;
ULONG Hi32;
....
} DECIMAL;

I have to compile my code using -DNONAMELESSUNION but can't recall if I
still need to do that.

Regards,
Manu


David Lowndes wrote:
>> I had some code that looks like:
>>
>> DECIMAL dec;
>>
>> ... dec->scale ...
>> which compiled fine until I use the latest Platform SDK (v6.1) for
>> which I get the following error:
>>
>> error C2039: 'scale' : is not a member of 'tagDEC'
>> C:\Program Files\Microsoft
>> SDKs\Windows\v6.1\Include\wtypes.h(1068) : see declaration of 'tagDEC'
>>
>> What is the proper way to have this code compile fine on older version
>> of the wtypes.h header and the new ones?
>
> What is the definition of struct tagDEC in the newer wtypes.h file?
>
> Dave