1

After discovering the fields of LVITEM for 64 bit in this question, there is one last thing I don't know. The documentation says that:

  1. puColumns is a UINT. It is a pointer to an array of column indices, specifying which columns are displayed for this item, and the order of those columns.
  2. piColFmt is a int. It is a pointer to an array of the following flags (alone or in combination), specifying the format of each subitem in extended tile view.

My question is why they are integers and not pointers? And in a 64 bit architecture, should they take 8 bytes like pointers or 4 bytes like integers?

Thank you!

Community
  • 1
  • 1
Ella Sharakanski
  • 2,683
  • 3
  • 27
  • 47
  • 1
    As noted in your previous question, the Windows SDK is the final authority for declarations like this. LVITEM is declared in include/commctrl.h. The MSDN article is buggy, puColumns is actually PUINT and piColFmt is int*. Both are thus pointers. – Hans Passant Jan 03 '15 at 14:13
  • I thought they are identical. Thanks! – Ella Sharakanski Jan 03 '15 at 17:39

1 Answers1

0

So the Windows SDK says:

typedef struct tagLVITEMA
{
    UINT mask;
    int iItem;
    int iSubItem;
    UINT state;
    UINT stateMask;
    LPSTR pszText;
    int cchTextMax;
    int iImage;
    LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
    int iIndent;
#endif
#if (_WIN32_WINNT >= 0x0501)
    int iGroupId;
    UINT cColumns; // tile view columns
    PUINT puColumns;
#endif
#if _WIN32_WINNT >= 0x0600 // Will be unused downlevel, but sizeof(LVITEMA) must be equal to sizeof(LVITEMW)
    int* piColFmt;
    int iGroup; // readonly. only valid for owner data.
#endif
} LVITEMA, *LPLVITEMA;
Ella Sharakanski
  • 2,683
  • 3
  • 27
  • 47