Carbon


GetControlDataSize

Header: Controls.h Carbon status: Supported

Obtains the size of a control’s tagged data.

OSErr GetControlDataSize (
    ControlRef inControl, 
    ControlPartCode inPart, 
    ResType inTagName, 
    Size *outMaxSize
);
Parameter descriptions
inControl

A handle to the control to be examined.

inPart

The part code of the control part with which the data is associated; see “Meta Control Part Code Constants”, “Control Part Code Constants”, and “Control State Part Code Constants”. Passing kControlEntireControl indicates that either the control has no parts or the data is not tied to any specific part of the control.

inTagName

A constant representing the control-specific data whose size is to be obtained; see the data tag constants in the “Control Manager Constants” section.

outMaxSize

On input, a pointer to a Size value. On return, the value is set to the size (in bytes) of the control’s tagged data. This value should be passed to SetControlData and GetControlData to allocate a sufficiently large buffer for variable-length data.

function result

A result code. The result code errDataNotSupported indicates that the inTagName parameter is not valid.

DISCUSSION

Pass the value returned in the outMaxSize parameter of GetControlDataSize in the inBufferSize parameter of SetControlData and GetControlData to allocate an adequate buffer for variable-length data.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)