Test the availability of a command.
GSErrCode ACAPI_Command_Test ( const API_ModulID* mdid, GSType cmdID, Int32 cmdVersion );
Parameters
- mdid
- [in] the identifier of the target add-on. It is defined by the ‘MDID’ resource.
- cmdID
- [in] the identifier of the command to be tested.
- cmdVersion
- [in] the required command version
Return Values
NoError
- the command is installed, it may be called
APIERR_BADPARS
- the
mdid
parameter isnullptr
APIERR_MODULNOTINSTALLED
- the referenced add-on is not installed
APIERR_MODULCMDNOTSUPPORTED
- the referenced command is not supported by the target add-on
APIERR_MODULCMDVERSNOTSUPPORTED
- the requested command version is too new; not supported by the target add-on
For other common errors see the list of error codes.
Remarks
This function is used to check the availability of an add-on’s command.
Call this function to check whether the requested command of another add-on is available. Depending on the result, for example you can modify your add-on’s interface. The following cases may happen:
- the command is installed,
- the target add-on is not installed
- the target add-on is installed, but the command is not supported,
- the target add-on is installed, the command is supported, but the command version is incorrect.
Refer to the ACAPI_Command_Call function to see the details of calling another add-on.
Refer to the paper of the Communication Manager for more details.
Example
The following sample checks whether the services of the standard DWF In-Out add-on are currently available:
API_ModulID mdid = { 1198731108, 3847165392 }; // MDID of the DWF In-Out add-on GSErrCode err = ACAPI_Command_Test (&mdid, 'DWFO', 4); if (err != NoError) { if (err == APIERR_MODULNOTINSTALLED) { // DWF In-Out add-on is not loaded } else { // incompatible version of DWF In-Out add-on } }
Requirements
- Version: API 3.1 or later
- Header: ACAPinc.h
See Also
API_ModulID, ‘MDID’
ACAPI_Command_Call
Communication Manager
API Functions