I'm using version 8 (.NET 2.0).
You were right, this does show the difference:
From MSVCMRTD.lib:
// TypDefName: tagTEXTMETRICA (02000028)
// Flags : [NotPublic] [SequentialLayout] [Class] [Sealed] [AnsiClass]
[BeforeFieldInit] (00100108)
// Extends : 0100000E [TypeRef] System.ValueType
// Layout : Packing:0, Size:56
// CustomAttribute #1 (0c000096)
// -------------------------------------------------------
// CustomAttribute Type: 0a000001
// CustomAttributeName: Microsoft.VisualC.DebugInfoInPDBAttribute ::
instance void .ctor()
// Length: 4
// Value : 01 00 00 00 >
<
// ctor args: ()
//
// CustomAttribute #2 (0c000097)
// -------------------------------------------------------
// CustomAttribute Type: 0a000002
// CustomAttributeName: Microsoft.VisualC.MiscellaneousBitsAttribute ::
instance void .ctor(int32)
// Length: 8
// Value : 01 00 41 00 00 00 00 00 > A
<
// ctor args: (65)
//
// CustomAttribute #3 (0c000098)
// -------------------------------------------------------
// CustomAttribute Type: 0a000003
// CustomAttributeName:
System.Runtime.CompilerServices.NativeCppClassAttribute :: instance void
.ctor()
// Length: 4
// Value : 01 00 00 00 >
<
// ctor args: ()
From my obj - (I've limited it down to 1):
// TypDefName: tagTEXTMETRICA (02000030)
// Flags : [NotPublic] [SequentialLayout] [Class] [Sealed] [AnsiClass]
[BeforeFieldInit] (00100108)
// Extends : 0100000B [TypeRef] System.ValueType
// Layout : Packing:0, Size:53
// CustomAttribute #1 (0c0000cf)
// -------------------------------------------------------
// CustomAttribute Type: 0a000001
// CustomAttributeName: Microsoft.VisualC.DebugInfoInPDBAttribute ::
instance void .ctor()
// Length: 4
// Value : 01 00 00 00 >
<
// ctor args: ()
//
// CustomAttribute #2 (0c0000d0)
// -------------------------------------------------------
// CustomAttribute Type: 0a000003
// CustomAttributeName: Microsoft.VisualC.MiscellaneousBitsAttribute ::
instance void .ctor(int32)
// Length: 8
// Value : 01 00 41 00 00 00 00 00 > A
<
// ctor args: (65)
//
// CustomAttribute #3 (0c0000d1)
// -------------------------------------------------------
// CustomAttribute Type: 0a000004
// CustomAttributeName:
System.Runtime.CompilerServices.NativeCppClassAttribute :: instance void
.ctor()
// Length: 4
// Value : 01 00 00 00 >
<
// ctor args: ()
Notice that the difference is the size! The library version is 56 bytes,
whereas the version that is in my dlls is 53 bytes! So, does that mean I
might be including the declaration of tagMETRICA from the VS7.1 headers
instead of the VS8 headers?
Thanks,
"consultutah@nospam.nospam"
<consultutahnospamnospam@discussions.microsoft.com> wrote
> I'm using version 8 (.NET 2.0).
Is that the RTM version? Or Beta 2?
[..]
> Notice that the difference is the size! The library version is 56 bytes,
> whereas the version that is in my dlls is 53 bytes! So, does that mean I
> might be including the declaration of tagMETRICA from the VS7.1 headers
> instead of the VS8 headers?
Unlikely. The size should always be the same (after all both VS 7.1
and VS 8 generated executables should run on Windows ;-) )
It looks like you have a bad alignment for the Windows headers.
I'm not sure whether the Windows headers are supposed to be
resilient to bad alignment settings.
Looking at your compiler settings there is -Zp1 which is likely
the culprit. I suggest you remove the switch, and add a
#pragma pack _after_ including the windows headers.
Ideally you should stick to standard alignment in the long term
and use #pragma pack or __declspec(align) only where needed.
-hg
consultutah@nospam.nospam - 01 Nov 2005 18:36 GMT
That was it. I will have to see why the packing was set at 1.... It does
seem odd.
But at very least you got me past that one!
Thanks,