DS_GetAttrType
HRESULT DS_GetAttrType (DSHandle DSHandle, const char *attributeName, unsigned int *type, unsigned int *dimension1, unsigned int *dimension2);
Purpose
Returns the data type of the data value of a DataSocket object's attribute.
This function is a convenience function that performs, in a single operation, the same task as calling DS_GetAttrHandle to obtain a handle to an attribute and then calling DS_GetDataType to get the type of the data value of the attribute.
Parameters
| Input | ||||||||||||||||||||||
| Name | Type | Description | ||||||||||||||||||||
| DSHandle | DSHandle | Pass the handle you obtained from DS_Open, DS_GetAttrHandle, or DS_CreateAttrHandle to identify the DataSocket object. | ||||||||||||||||||||
| attributeName | const char * | A string to specify the name of the attribute. If the attribute does not exist, this function returns E_INVALIDARG (0x80070057). | ||||||||||||||||||||
| Output | ||||||||||||||||||||||
| Name | Type | Description | ||||||||||||||||||||
| type | unsigned int | Returns a constant that indicates the type of the attribute's data value. Pass NULL if you do not want this information. The data value can be one of the valid types or an array of one of the valid types other than CAVT_VARIANT. The following table lists the valid type constants and their corresponding C/Windows types:
int isArray = (type & CAVT_ARRAY);
|
||||||||||||||||||||
| dimension1 | unsigned int | Returns the length of the string if the type of the attribute's data value is CAVT_CSTRING. The length does not include the terminating NUL byte. Returns the number of elements in the array if the attribute's data value is a 1D array of any type. Returns the size of the first dimension of the array if the attribute's data value is a 2D array of any type. If the attribute's data value is not a string or an array, the value returned is not defined. Pass NULL if you do not want this value. |
||||||||||||||||||||
| dimension2 | unsigned int | Returns the size of the second dimension of the array if the attribute's data value is 2D array of any type. If the attribute's data value is not a 2D array, the value returned is not defined. Pass NULL if you do not want this value. |
||||||||||||||||||||
Return Value
| Name | Type | Description |
| status | HRESULT | The value that indicates whether an error occurred. A negative error code indicates function failure. Error codes are defined in CVIversion\toolslib\datasock\dataskt.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h. Other error codes in winerror.h are generated by ActiveX Servers and are passed on to you by the DataSocket Library. |
Additional Information
Library: DataSocket Library
Include file: datasock\dataskt.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later
