Properties are used to store data, and are defined by two characteristics:
The property identifier and data type are combined together in a ULONG value to define the CEPROPID for the property. For example, const CEPROPID propCompany = MAKELONG(CEVT_LPWSTR, 100); You can choose any value for the property identifier, as long as it is unique for the properties in the database. A property in a database is accessed through the CEPROPVAL structure: typedef struct _CEPROPVAL { CEPROPID propid; WORD wLenData; WORD wFlags; CEVALUNION val; } CEPROPVAL; typedef CEPROPVAL *PCEPROPVAL; The propid member is assigned the CEPROPID value created for the field, as shown above. The val member is a union used to store the value associated with the property. The member wLenData is not used, and wFlags is used when property values are retrieved or deleted. So, you might write the following code to create a CEPROPVAL structure ready for writing to the database. CEPROPVAL propValCompany; propValCompany.val.lpwstr = _T("My Company"); propValCompany.propid = propCompany; propValCompany.wFlags = 0;
|