Reading a View's Columns

The columns are read from the binary stream immediately after the VD structure is read. The VD structure is the first block of data in this stream.

The cvcd member of the VD structure contains the number of columns. The number of columns in the view will be stored in pvd->cvcd, where pvd is a pointer to a VD. You will need to declare a pointer to the pvcd parameter in the VCD structure to hold the view column descriptors. With this information, the following steps are necessary to read in the view's column descriptors.

  1. Allocate memory for the array of VCD structures. The size of the allocation must be the number of the columns in the view (cvcd) plus one, times the size of the VCD structure. There is one extra element to hold the parent display column which is appended on the end.
  2. For each VCD structure,
    1. Read the structure from the stream.
    2. If the VCD structure has a named property (that is, VCDF_NAMEDPROP set in pvcd->ulFlags), you must read it in. To read the named property, allocate a pointer to hold a GUID structure, and read the GUID from the binary stream. The pointer to the GUID structure should be saved in
    3. pvcd->mnid->lpguid.

      If the named property has a string (that is, pvcd->mnid->ulKind == MNID_STRING), read it from the binary stream. The first DWORD is the length of the string, the string immediately follows in the stream. The pointer to the string should be saved in

      pvcd->mnid-> lpwstrName.

    4. Read the column display name from the string stream and store the pointer with the column descriptor.

Because named property identifiers are imbedded between VCD structures in the stream, you cannot read all VCD structures at once.

The 'drag column' must be the first column in the view descriptor. This column is used to drag-select a number of messages without invoking the move message operation. This column can be seen in the heading of the main viewer as a narrow rectangle.

The 'action icon' column is added to a view column descriptor for the remote views. This column indicates whether the message is to be downloaded or not.

The 'parent display' column is a column added to the end of views defined in the Finder. This column is labeled 'In Folder' in the finder's viewer.