Your application must allocate memory for a container record by using the CM_ALLOCRECORD message, which also enables you to allocate memory for additional application data.
The maximum number of records is limited by the amount of memory in the user's computer. The container control does not limit the number of records that a container can have.
The following sample code shows how to allocate memory for records that populate the container. A pointer to the record is returned.
HWND hIcon; PRECORDCORE Address, FirstRec; RECORDINSERT recsIn; ULONG x; /**********************************************************************/ /* Allocate MAXFRIENDS records all at once - */ /* CM_ALLOCRECORD returns them in a linked list. */ /**********************************************************************/ Address = (PRECORDCORE)WinSendMsg(hWnd, CM_ALLOCRECORD, 0, MPFROMLONG(MAXFRIENDS));
Your application can use the CM_ALLOCRECORD message to allocate memory for one or more container records. The application can request n container records with an nRecords parameter. If n is one, a pointer to that record is returned. If n is greater than one, a pointer to the first record in a linked list of n records is returned.