What Does It Mean, "Canonical"?

The word "canonical" means "the simplest form of something," which is the basic idea behind GetCanonicalFormatEtc. This function allows a consumer to obtain a FORMATETC structure that describes exactly the same rendering of a difficult FORMATETC. In general, the canonical FORMATETC should contain the most general information possible for a specific rendering. For example, a data source that always provides the same metafile for any device, for either DVASPECT_CONTENT or DVASPECT_THUMBNAIL aspects, would return from this function a structure with cfFormat set to CF_METAFILEPICT, dwAspect set to content and thumbnail, ptd set to NULL (device independent), and lindex set to -1 (tymed is irrelevant). All other FORMATETC descriptions with a specific target device are more specific instances of this basic, canonical FORMATETC.

The simplest implementation of GetCanonicalFormatEtc copies the input structure to the output structure, sets the output ptd field to NULL, and returns DATA_S_SAMEFORMATETC. This says that the data object doesn't care about target devices for the specific FORMATETC. If, on the other hand, the source does care, it returns NOERROR, filling the output FORMATETC as generally as it can.

The entire reason for GetCanonicalFormatEtc is to give a consumer a way to compare whether two calls to GetData with two different FORMATETC structures will produce exactly the same rendering. If so, the consumer can bypass the second GetData call and use the data obtained from the first. This cuts down on memory wasted for duplicate renderings and improves overall performance.