Describing this OperationThis operation is designed to: Methodology You choose the working mode (Process or library) of the operation. In library mode, the name
of the function, which corresponds to the name of the CAA function to call, is
required. In this mode, the Process Name input is the library name. The library name
does not need the extension (like .dll under Windows OS), the operation being OS
independent, it looks automatically for the library corresponding to the current
Operating System. Arguments: The behavior itself and the extended object.
ExampleWhen working with the CAA function, make sure that this function has the following signature: #ifdef _WINDOWS_SOURCE #define EXDLL_API __declspec(dllexport) #else #define EXDLL_API #endif extern "C" EXDLL_API HRESULT MyCAAFunction(CATIVariableManagement* iBehavior, CATIVariableManagement*iExtendedObject);The inputs are those defined on the operation. As the operation is an argument of the function, the CATIVariableManagement interface is used to retrieve
the operation inputs. Operation outputs are managed using the same interface.
extern "C" HRESULT MyCAAFunction(CATIVariableManagement* iBehavior, CATIVariableManagement*iExtendedObject)
(
HRESULT resu = E_FAIL;
if (!iBehavior || !iExtendedObject)
return resu;
//We retrieve the interface CATIProduct on iExtendedObject
CATIProduct* ExtProd = NULL;
HRESULT rc = iExtendedObject->QueryInterface(IID_CATIProduct, (void**)& ExtProd);
if (SUCCEEDED(rc))
{
//the product has to have 2 children products
int nbChildren = ExtProd->GetChildrenCount();
if (nbChildren!=2)
return resu;
CATListValCATBaseUnknown_var* ExtProdChildren = NULL;
ExtProdChildren = ExtProd->GetChildren();
if (ExtProdChildren)
(
//We change the number of the first subproduct
CATIProduct_var FirstChild = (*ExtProdChildren)[1];
if(!!FirstChild)
{
FirstChild->SetPartNumber("FirstSubProduct");
resu = S_OK;
}
else
return resu;
)
CATSysReleasePtr(ExtProd);
}
return resu;
)
Note:
The process must be accessible in the run time view for
portable applications.
Using this Operation Interface
Using this OperationYou want to perform advanced operations using C++. | |||||||||||||||