LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

CA_InvokeHelperEx

CA_InvokeHelperEx

HRESULT CA_InvokeHelperEx (CAObjHandle objectHandle, ERRORINFO *errorInfo, const IID *interfaceId, int methodOrPropertyID, int operation, unsigned int returnType, void *returnValue, size_t parameterCount, unsigned int parameterTypes[], ...);

Purpose

Note   This function is used by the functions generated by the ActiveX Controller Instrument Driver Wizard. It is not intended to be used directly.

Calls methods or gets and sets a property of an ActiveX server. Unlike CA_InvokeHelperVEx, you pass the ActiveX function arguments as comma-separated parameters.

Parameters

Input
Name Type Description
objectHandle CAObjHandle An ActiveX object handle returned in an output parameter of an ActiveX server function or a function in the Creating ActiveX Objects class in this library.
interfaceId const IID * The interface id specifying the type of interface pointer to be used for the property or method access.

You must pass the UUID of an interface implemented by the object passed in the objectHandle parameter or zero to indicate the current interface id that is stored in that object handle.
methodOrPropertyID int The Id of the method or property being called or accessed.

This Id can be obtained from the object's type library.
operation int The type of operation to be performed. The operation type must be one of the following values:

DISPATCH_METHOD
DISPATCH_PROPERTYGET
DISPATCH_PROPERTYPUT
DISPATCH_PROPERTYPUTREF
returnType unsigned int The type passed depends on the value of the operation parameter, which can be one of the following values:

DISPATCH_METHOD The type of the return value of the function.
DISPATCH_PROPERTYGET The type of the Property being accessed.
DISPATCH_PROPERTYPUT
or DISPATCH_PROPERTYPUTREF
Always CAVT_EMPTY.
For DISPATCH_METHOD and DISPATCH_PROPERTYGET, the type can be any of the data types for variants and safe arrays except CAVT_NULL.
parameterCount size_t This argument depends on the value of the operation parameter as follows.

DISPATCH_METHOD The number of arguments to be passed to the ActiveX server function.
DISPATCH_PROPERTYGET Always pass 0.
DISPATCH_PROPERTYPUT
or DISPATCH_PROPERTYPUTREF
Always pass 1.
parameterTypes unsigned int [] An array of parameter type descriptions. The size of the array must match the value passed in the parameterCount parameter.

For DISPATCH_PROPERTYGET, pass NULL.

For DISPATCH_PROPERTYPUT and DISPATCH_PROPERTYPUTREF pass an array containing the type of the property.

For DISPATCH_METHOD, pass an array containing the types of the arguments to the ActiveX server function.

Each entry in this array can consist of any of the data types for variants and safe arrays except CAVT_NULL.

If the parameter is a reference parameter, you can bitwise OR all the constants with data type modifiers except for CAVT_EMPTY and CAVT_NULL.
automationFunctionParameters ... The arguments to the ActiveX server operation. You must separate multiple arguments by a comma.

The number of arguments passed must match the count passed in the parameterCount parameter.

For DISPATCH_PROPERTYGET, do not pass any arguments.

For DISPATCH_PROPERTYPUT and DISPATCH_PROPERTYPUTREF, pass the value you want to assign to the property.

For DISPATCH_METHOD, pass the arguments to the ActiveX server function.
Output
Name Type Description
errorInfo ERRORINFO When the ActiveX server method invoked by this function fails with the error code DISP_E_EXCEPTION, descriptive information about the error code is stored in this parameter. The descriptive information includes the error code, source, and description. The information also can include a help file and help file context.

When the ActiveX server method invoked by this function fails with the error codes DISP_E_PARAMNOTFOUND, DISP_E_TYPEMISMATCH, or E_INVALIDARG, the parameter position of the invalid argument can be stored in the errorParamPos member of this parameter.

This parameter can be NULL.
returnValue void * This argument depends on the value of the operation parameter as follows.

DISPATCH_METHOD The value returned by the ActiveX server function.
DISPATCH_PROPERTYGET The value of the property.
DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF Always pass NULL.

Return Value

Name Type Description
status HRESULT A value indicating whether an error occurred. Negative error codes indicate function failure.

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 ActiveX servers and passed on to you by the LabWindows/CVI 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.

Additional Information

Library: ActiveX Library

Include file: cviauto.h

LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later

Was this information helpful?