RE: PB/DLL 6 and VB 5
The help for PB implies that VB aligns each member of a UDT by DWORD.
"The memory address for each member of the UDT must begin at a location evenly divisible by 4 (there are 4 bytes in a DWORD)."
I am seeing different results. To me, it appears the total size of a VB UDT must be divisible by 4 AND any needed padding is inserted after the first member in the UDT that is not divisible by 4 (remember that two VB integers are "packed").
The two are "equal" when passing a record ByRef between PB and VB.
Dennis
The help for PB implies that VB aligns each member of a UDT by DWORD.
"The memory address for each member of the UDT must begin at a location evenly divisible by 4 (there are 4 bytes in a DWORD)."
I am seeing different results. To me, it appears the total size of a VB UDT must be divisible by 4 AND any needed padding is inserted after the first member in the UDT that is not divisible by 4 (remember that two VB integers are "packed").
The two are "equal" when passing a record ByRef between PB and VB.
Code:
TYPE PBType Mem_A AS STRING * 10 PAD AS STRING * 2 Mem_B AS Currency Mem_C AS Currency Mem_D AS STRING * 5 Mem_E AS STRING * 32 Mem_F AS STRING * 14 Mem_G AS STRING * 32 Mem_H AS STRING * 32 Mem_I AS STRING * 32 Mem_J AS STRING * 27 Mem_K AS STRING * 4 Mem_L AS STRING * 10 Mem_M AS LONG Mem_N AS LONG Mem_O AS LONG END TYPE TYPE VBType Mem_A AS STRING * 10 Mem_B AS Currency Mem_C AS Currency Mem_D AS STRING * 5 Mem_E AS STRING * 32 Mem_F AS STRING * 14 Mem_G AS STRING * 32 Mem_H AS STRING * 32 Mem_I AS STRING * 32 Mem_J AS STRING * 27 Mem_K AS STRING * 4 Mem_L AS STRING * 10 Mem_M AS LONG Mem_N AS LONG Mem_O AS LONG END TYPE
Comment