Jump to content

CLASSFIELDINFO

From EDM2
Revision as of 02:52, 3 May 2025 by Martini (talk | contribs) (Created page with "Class field information data structure for use with the wpclsQueryDetailsInfo method. == Type == struct == C Declaration Method == typedef struct ==Remarks== The CLASSFIELDINFO data structure is similar to the FIELDINFO data structure of the container control, with the following differences: The offStruct field from the FIELDINFO data structure is changed to ulReserved. Compare, Sort, and Ownerdraw fields (starting at pfnOwnerDraw and continuing through the end of t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Class field information data structure for use with the wpclsQueryDetailsInfo method.

Type

struct

C Declaration Method

typedef struct

Remarks

The CLASSFIELDINFO data structure is similar to the FIELDINFO data structure of the container control, with the following differences:

The offStruct field from the FIELDINFO data structure is changed to ulReserved.

Compare, Sort, and Ownerdraw fields (starting at pfnOwnerDraw and continuing through the end of the structure) have been added so that object Details View fields can be customized and objects can be found or included by any of their displayable object Details View fields.

The offFieldData and ulLenFieldData fields have been added.

As an example of the use of these two fields, if an application has the following details data:

    typedef struct _SAMPLE {
       CDATE  cdate;
       CTIME  ctime;
       PSZ    psz;
    }  SAMPLE;

then

    classfieldinfo[0].offFieldData   = FIELDOFFSET(SAMPLE,cdate);
    classfieldinfo[0].ulLenFieldData = FIELDOFFSET(SAMPLE,ctime) -
                                       FIELDOFFSET(SAMPLE,cdate);

    classfieldinfo[1].offFieldData   = FIELDOFFSET(SAMPLE,ctime);
    classfieldinfo[1].ulLenFieldData = FIELDOFFSET(SAMPLE,psz) -
                                       FIELDOFFSET(SAMPLE,ctime);

    classfieldinfo[2].offFieldData   = FIELDOFFSET(SAMPLE,psz);
    classfieldinfo[2].ulLenFieldData = sizeof(SAMPLE) -
                                       FIELDOFFSET(SAMPLE,psz);

    /* FIELDOFFSET is a macro that calculates the byte offset of a field *
     * within a structure.                                               */

Note: It is essential that the fields be linked in the order shown above-cdate must be followed by ctime, and finally psz.

The pfnCompare and pfnSort fields generally point to the same function, but they can point to different functions if you want them to behave differently.

Example Code

typedef struct _CLASSFIELDINFO {
  ULONG                        cb;                   /* Size of the CLASSFIELDINFO structure. */
  ULONG                        flData;               /* Attributes of the field's data. */
  ULONG                        flTitle;              /* Attributes of the field's title. */
  PVOID                        pTitleData;           /* Title data. */
  ULONG                        ulReserved;           /* Reserved. */
  PVOID                        pUserData;            /* Pointer to user data. */
  struct _CLASSFIELDINFO      *pNextFieldInfo;       /* Pointer to the next linked CLASSFIELDINFO structure. */
  ULONG                        cxWidth;              /* Width of the field in pels. */
  ULONG                        offFieldData;         /* Offset from beginning of this class's data for this field. */
  ULONG                        ulLenFieldData;       /* Width of data in bytes. */
  PFNOWNDRW                    pfnOwnerDraw;         /* Ownerdraw procedure for Details View column. */
  ULONG                        flCompare;            /* Flags. */
  PFNCOMPARE                   pfnCompare;           /* Pointer to a comparison function. */
  ULONG                        DefaultComparison;    /* Default comparison operator in the Include Page Criteria dialog box (in the Settings notebook). */
  ULONG                        ulLenCompareValue;    /* Maximum length of the compare data. */
  PVOID                        pDefCompareValue;     /* The default value to be used for comparisons. */
  PVOID                        pMinCompareValue;     /* The default value to be used for comparisons. */
  PVOID                        pMaxCompareValue;     /* The default value to be used for comparisons. */
  PSZ                          pszEditControlClass;  /* Window class to be used to edit the compare value. */
  PFNCOMPARE                   pfnSort;              /* Sort function for this field. */
  PSZ                          pNewComp;             /* Pointer to an array of strings containing a description of a comparison type. */
} CLASSFIELDINFO;

typedef CLASSFIELDINFO *PCLASSFIELDINFO;