Ole4D Methods

OCSetAsynchHandler(p_Area;p_Event;p_Method )


Associates a 4D method to an event of an Ole object. When the event occurs, the 4D method that is associated to the event is called.
This method is different from OCSetEventHandler because the events are put in a queue and they are all executed in the current process.
The OCSetAsynchHandler command has some restrictions: you cannot set the value of event parameters.
However, except this specific case when you want to set the value of event parameters, it is recommended to be used instead the OCSetEventHandler command.

Parameters
Parameter Type   Description
p_Area Longint -> Variable of the plug-in area.
p_Event String -> Name of the ole object event for which the handler is set.
p_Method String -> Name of the method to call in case this event occurs.
This must be a method that takes one parameter. The parameter is of type String, and is used by the plug-in to identify the event.
A script host used in a 4D event handling method contains parameters of the event and the object of the event.


Return Values
0 – The method call was successful.
If the method call was not successful the return value is non zero. For more information call OCLastError.

Example
$i := OCSetEventHandler(OCONT1,”NodeClick”,”OnNodeClick”)
`do some processing……………………
$i := OCRemoveHandler(OCONT1,”NodeClick”)


See Also
OCRemoveHandler , Write event handlers