CA_ServerSetErrorInfo
HRESULT CA_ServerSetErrorInfo (CAServerObjHandle serverObjectHandle, const IID *interfaceId, const char *description, const char *helpFileName, int helpContext);
Purpose
On an error condition, call this function in the implementation of an ActiveX interface's method or property to set rich error information. This information is made available to ActiveX clients through COM. Apart from the information input to this function, the ProgID of the server is also made available.
![]() |
Note To call this function, the ActiveX object whose handle is passed in the first parameter must support ErrorInfo (must implement the ISupportErrorInfo interface). |
Call CA_ServerSetErrorInfo only from implementations of an ActiveX interface's methods and properties. Do not call this function from anywhere else, including ActiveX object callback functions.
After calling this function, the implementation of the ActiveX interface's method or property must return as soon as possible.
Parameters
Input | ||||
Name | Type | Description | ||
serverObjectHandle | CAServerObjHandle | The handle to an ActiveX object in your ActiveX server. | ||
interfaceId | const IID * | Interface id of the interface whose method or property sets the ErrorInfo object. | ||
description | const char * | A NUL-terminated string describing the error. This parameter can be NULL. |
||
helpFileName | const char * | The name of the help file that contains more information about this error. This parameter can be NULL.
|
||
helpContext | int | The help context of this error. This value is ignored if the helpFileName parameter is NULL. Pass -1 if you do not want to set the help context. |
Return Value
Name | Type | Description | ||
status | HRESULT | A value indicating whether an error occurred. Function failure is indicated by a negative error code. Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h. The LabWindows/CVI ActiveX Library explicitly returns error codes. Other error codes in winerror.h are generated by the COM runtime and passed on to you by the ActiveX Library. You can use CA_GetAutomationErrorString to get the description of an error code or CA_DisplayErrorInfo to display the description of the error code.
The error codes defined in <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h are too numerous to display here. These error codes can be returned to your ActiveX clients. |
Additional Information
Library: ActiveX Library
Include file: cviauto.h
LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later