Jump to content

CM REMOVEDETAILFIELDINFO

From EDM2
Revision as of 01:08, 21 April 2025 by Martini (talk | contribs) (Created page with "This message removes one, multiple, or all FIELDINFO structures from the container control. ==Syntax== <PRE> param1 PVOID pFieldInfoArray; Pointer to an array of pointers to FIELDINFO structures that are to be removed.: param2 USHORT cNumFieldInfo; Number of FIELDINFO structures to be removed.: USHORT fRemoveFieldInfo; Flags.: </PRE> ==Parameters== ;pFieldInfoArray (PVOID) - Input : Pointer to an array of pointers to FIELDINFO structures tha...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message removes one, multiple, or all FIELDINFO structures from the container control.

Syntax

param1
PVOID pFieldInfoArray; /* Pointer to an array of pointers to FIELDINFO structures that are to be removed. */

param2
USHORT cNumFieldInfo;  /* Number of FIELDINFO structures to be removed. */
USHORT fRemoveFieldInfo; /* Flags. */

Parameters

pFieldInfoArray (PVOID) - Input
Pointer to an array of pointers to FIELDINFO structures that are to be removed.
cNumFieldInfo (USHORT) - Input
Number of FIELDINFO structures to be removed. If the cNumFieldInfo parameter has a value of 0, all of the FIELDINFO structures in the container are removed and the pFieldInfoArray parameter is ignored.
fRemoveFieldInfo (USHORT) - Input
Flags that show whether memory must be freed and FIELDINFO structures invalidated.
CMA_FREE: If specified, FIELDINFO structures are removed and memory associated with the FIELDINFO structures is freed. If not specified, FIELDINFO structures are removed and no memory is freed; this is the default.
CMA_INVALIDATE: If specified, after FIELDINFO structures are removed, the container is invalidated, and any necessary repositioning of the FIELDINFO structures is performed. If not specified, invalidation is not performed.

Returns

cFields (SHORT) - returns
Number of structures.
-1: An error occurred. The WinGetLastError function may return the following errors:
PMERR_INVALID_PARAMETERS
PMERR_MEMORY_DEALLOCATION_ERR
Other: The number of FIELDINFO structures that remain in the container.

Remarks

The FIELDINFO structures are removed from the list of columns inserted into the container control.

If the CMA_FREE attribute is not specified, the container control removes the specified FIELDINFO structures without freeing the memory. The application is responsible for freeing the memory associated with the FIELDINFO structures by using the CM_FREEDETAILFIELDINFO message.

If the cNumFieldInfo parameter has a value of 0 and the CMA_FREE attribute is specified, all of the FIELDINFO structures in the container control are removed and the memory associated with the FIELDINFO structures is freed. It is the application's responsibility to free all of the application-allocated memory associated with the FIELDINFO structures.

If the number of pointers to FIELDINFO structures in the array exceeds the count of FIELDINFO structures to be removed, only the number of structures specified in the cNumFieldInfo parameter are removed. If the CCS_VERIFYPOINTERS style bit is set and the pFieldInfoArray parameter contains pointers to a FIELDINFO structure or structures that do not exist, the PMERR_INVALID_PARAMETERS error is set.

If you do not want to show a column, you can hide it by setting the CFA_INVISIBLE attribute of the FIELDINFO data structure and notifying the container control with the CM_INVALIDATEDETAILFIELDINFO message.

If the CMA_INVALIDATE attribute is specified, the container is repainted.

Default Processing

The default window procedure does not expect to receive this message and therefore takes no action on it other than to return 0.