handle calls to the callback function in OpenMaple - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : Session State and Input-Output Functions : OpenMaple/VB/callBackCallBack

callBackCallBack - handle calls to the callback function in OpenMaple

Calling Sequence

callBackCallBack(data, output)




user_data pointer passed to StartMaple (Long)



arguments (byte array pointer)



This OpenMaple function is part of the MapleCallBack structure passed as an argument to StartMaple.


The callBackCallBack function executes when the Maple callback function is evaluated.  The callback function is application dependent, and can do whatever the driving application directs.


The prototype for the function you can assign to the entry in the MapleCallBack must look like the following.

Function CallBackCallBack(ByVal data As Long, ByVal Output as Long) as Long


The output parameter contains the text version of the parameters passed to the Maple callback function.


On return, the callBackCallBack function returns either a 0 or a pointer to a string containing a valid Maple expression. If the callBackCallBack function returns NULL, the Maple callback function returns nothing.  Otherwise the return value is parsed assuming it contains a Maple command string.  Maple parses the expression but does not evaluate it, and returns it as the result of the callback function.


This function can be used to explicitly pass intermediate values of a computation to your code and to return a value to Maple.


If no callBackCallBack function is provided, any attempt to execute the Maple callback function produces an error (reported using the errorCallBack function or textCallBack function).


The data parameter contains the same data as passed to StartMaple in the user_data parameter.


Function CallBackCallBack(ByVal data As Long, ByVal Output As Long) As Long

   Dim args As String

   args = MaplePointerToString(Output)

   CallBackCallBack = MapleStringToPointer("2*" + args + ";")

End Function

' assignment to MapleCallback entry

cb.lpCallBackCallBack = GetProc(AddressOf CallBackCallBack)

' test statement that will invoke the CallBackCallBack

EvalMapleStatement kv, "callback(x^2+3*x+1);"

See Also

errorCallBack, OpenMaple/VB/API, OpenMaple/VB/Examples, queryInterrupt, readLineCallBack, redirectCallBack, StartMaple, statusCallBack, streamCallBack, textCallBack

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam