Admin Production ni-theme
Current Publication

CA_BSTRGetCString

LabWindows/CVI

CA_BSTRGetCString

HRESULT CA_BSTRGetCString (BSTR BSTR, char **cString);

Purpose

Converts a BSTR into a C-style string. A BSTR is a Basic-style string that stores both text and length information.

CA_BSTRGetCString does not free the BSTR.

Call CA_FreeMemory when you no longer need the C-style string.

Parameters

Input
Name Type Description
BSTR BSTR BSTR you want to convert to a C-style string.
Output
Name Type Description
cString char * Dynamically allocated C-style string that CA_BSTRGetCString converts from the Basic-style string.

Call CA_FreeMemory when you no longer need the C-style string.

Return Value

Name Type Description
result HRESULT >=0 Number of bytes in the C-style string.

<0 Error code.

Refer to <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h for Windows SDK error codes.

Additional Information

Library: ActiveX Library

Include file: cviauto.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later