From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

Content Type
Programming Language
Current manual

CA_ServerQueryInterface

CA_ServerQueryInterface

HRESULT CA_ServerQueryInterface (IUnknown *thisInterfacePtr, const IID *interfaceId, void *newInterfacePtr);

Purpose

Implementation of the IUnknown::QueryInterface method used in the ActiveX servers generated by the ActiveX Server Wizard. This function queries a COM object as to whether it implements a specific interface.

Parameters

Input
Name Type Description
thisInterfacePtr IUnknown * The IUnknown interface pointer of your ActiveX object.
interfaceId const IID * Interface id for the interface requested from the object.
Output
Name Type Description
newInterfacePtr void * The interface pointer (of the type passed in the Interface Id parameter) obtained from your ActiveX object.

Pass the address of an interface pointer variable of the required interface type.

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.

Note   You should not return the ActiveX Library error codes from your ActiveX server to your ActiveX clients, unless you document them in your server documentation. An acceptable compromise in this case is to return E_UNEXPECTED to the clients.

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

Was this information helpful?

Help us improve your future ni.com experience.

Did you find the documentation you were looking for?

Submit