LabWindows/CVI

DS_GetAttrNames

HRESULT DS_GetAttrNames (DSHandle DSHandle, char ***names, unsigned int *numberOfAttributes);

Purpose

Returns the names of all the attributes of a DataSocket object.

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.
Output
Name Type Description
names char ** Returns an array of strings that contains the attribute names.

This function allocates the array and each string. If the DataSocket object you specify does not have any attributes, this parameter returns NULL.

You must call DS_FreeMemory on each string and on the array when you finish using the names.

The following code demonstrates how you can free the memory:

char **names = NULL;
int numberOfNames;
int n;
DS_GetAttrNames (dsHandle, &names, &numberOfNames);
for (n = 0; n < numberOfNames; n++)
   DS_FreeMemory (names[n]);DS_FreeMemory (names);

numberOfAttributes unsigned int Returns the number of attributes of the DataSocket object you specify.

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

Log in to get a better experience