LabWindows/CVI

DS_GetLastError

HRESULT DS_GetLastError (DSHandle DSHandle, HRESULT *error);

Purpose

Returns the error code that the DataSocket object stored when its status was last updated. A value of 0 indicates no error.

Common errors are caused by incorrect network configurations, insufficient access privileges to connect to the DataSocket data source, or incorrectly formed URLs.

The value of the error code is an HRESULT. HRESULT is the ActiveX data type used to report errors. The HRESULT can describe errors detected by the DataSocket object or by the operating system's networking services. If you receive an error, call DS_GetLastMessage for a text description of the error.

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
error HRESULT The error code last stored by the DataSocket object.

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