DexObject_AddMethod()

Examples


The DexObject_AddMethod() function adds a method to a callback object.

Syntax

DexObject_AddMethod(callback_object, method_name, function script
{, dispatch_id})

Parameters

callback_object – A reference to the callback object to which the method is being added.

method_name – A string specifying the name for the method. Each method in the callback object must have a unique name.

function script – A user-defined function that is run when the method in the callback object is invoked.

dispatch_id – An optional long integer that uniquely identifies the method in the callback object. It is typically represented as a hexadecimal value. This value is required if the callback object is being used as an event handler.

Return value

A boolean indicating whether the method was added. True indicates that the method was added, while false indicates that it was not.

Comments

If you are creating a callback object to handle events from another application, be sure the method has exactly the same name as the corresponding method in the COM interface for that application. The name is case-sensitive.


Documentation Feedback