3.6 DM_CallFunction
To call any functions known to Dialog Manager in other parts of the application, the function DM_CallFunction has to be used. The function calls the corresponding function in any application part.
DM_Boolean DML_default DM_EXPORT DM_CallFunction
(
DM_ID funcID,
DM_UInt argcount,
DM_Value *argvec,
DM_Value *result,
DM_Options options
)
Parameters
-> DM_ID funcID
Identifier of the function to be called.
-> DM_UInt argcount
Specifies the number of parameters that are to be used when calling the function. The assignment of parameters can be read from the corresponding element in the argvec parameter. argcount must correspond exactly to the actual assignment of the argvec parameter. The maximum number is 8.
<-> DM_Value *argvec
This parameter is an array of DM_Value values which are to be used as parameters for the function call. The length of the vector has to correspond exactly to the value of argcount.
<- DM_Value *result
This returns the return value of the function, if the function call could be carried out.
-> DM_Options options
Currently not used. Please specify with 0.
Return Value
TRUE |
Function has been called successfully. |
FALSE |
Function could not be called. |
Example
A function defined in the dialog is to be called by means of an integer parameter.
void DML_default DM_ENTRY CALLFUNC __((DM_ID Funktion))
{
DM_Value argv;
DM_Value retval;
argv.type = DT_integer;
argv.value.integer = 888;
if (DM_CallFunction (Funktion, 1, &argv, &retval, 0))
if (retval.type == DT_integer)
printf(Erhaltener Wert: %ld", retval.value.integer);
}
See Also
Object application