I'm debating how to declare the following structure in VB:
Code:
#pragma pack(4)
typedef struct _tableCellParms
{ // EM_INSERTTABLE lparam is a (TABLECELLPARMS *)
LONG dxWidth; // Cell width (\cellx)
WORD nVertAlign:2; // Vertical alignment (0/1/2 = top/center/bottom
// \clvertalt (def), \clvertalc, \clvertalb)
WORD fMergeTop:1; // Top cell for vertical merge (\clvmgf)
WORD fMergePrev:1; // Merge with cell above (\clvmrg)
WORD fVertical:1; // Display text top to bottom, right to left (\cltxtbrlv)
WORD fMergeStart:1; // Start set of horizontally merged cells (\clmgf)
WORD fMergeCont:1; // Merge with previous cell (\clmrg)
WORD wShading; // Shading in .01% (\clshdng) e.g., 10000 flips fore/back
SHORT dxBrdrLeft; // Left border width (\clbrdrl\brdrwN) (in twips)
SHORT dyBrdrTop; // Top border width (\clbrdrt\brdrwN)
SHORT dxBrdrRight; // Right border width (\clbrdrr\brdrwN)
SHORT dyBrdrBottom; // Bottom border width (\clbrdrb\brdrwN)
COLORREF crBrdrLeft; // Left border color (\clbrdrl\brdrcf)
COLORREF crBrdrTop; // Top border color (\clbrdrt\brdrcf)
COLORREF crBrdrRight; // Right border color (\clbrdrr\brdrcf)
COLORREF crBrdrBottom; // Bottom border color (\clbrdrb\brdrcf)
COLORREF crBackPat; // Background color (\clcbpat)
COLORREF crForePat; // Foreground color (\clcfpat)
} TABLECELLPARMS;
The bitfield is only 7 bits, but declared as a WORD (2 bytes), in a structure subject to 4-byte packing... would I declare it as a single byte, or 2 bytes, and what would the offset of wShading need to be?