CUA container control is the primary key of interacting with Workplace Shell objects. All objects with which the user interacts are simply records that have been inserted into a container control.
The container control uses RECORDCORE and MINIRECORDCORE structures to represent the items that it holds. Memory for these structures is allocated by sending the container a CM_ALLOCRECORD message. When memory is allocated, the records may be inserted using the CM_INSERTRECORD message. The Workplace Shell provides object instance methods that perform all of this for you.
When an object is created, the Workplace Shell automatically allocates memory for the MINIRECORDCORE structure and stores the pointer in the object's instance data. Only one MINIRECORDCORE per object is used even if the object exists in multiple views.
The wpQueryCoreRecord method can be used to obtain the pointer to the MINIRECORDCORE structure that was allocated when the object was created. You would use this method to obtain a pointer to the MINIRECORDCORE structure that the container is using to represent the object. This may be necessary if you need to perform a task and no instance method for that task exists. If the container can perform the task, the application can use _wpQueryCoreRecord to obtain the PMINIRECORDCORE and send the container a message explicitly. The OBJECT_FROM_PREC macro performs the inverse function of _wpQueryCoreRecord and is used to obtain a pointer to the object (self) when the pointer to the MINIRECORDCORE structure is known.