NPN_InvokeDefault

我们的志愿者还没有将这篇文章翻译为 中文 (简体) 。加入我们帮助完成翻译!

« Gecko Plugin API Reference « Scripting plugins

Summary

Invokes the default method, if one exists, on the given NPObject.

Syntax

#include <npruntime.h>
 
bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
                       uint32_t argCount, NPVariant *result);

Parameters

The function has the following parameters:

<tt>npp</tt>
The NPP indicating which plugin wants to call the default method on the object.
<tt>npobj</tt>
The object on which to invoke the default method.
<tt>args</tt>
An array of arguments to pass to the default method.
<tt>argCount</tt>
The number of arguments in the <tt>args</tt> array.
<tt>result</tt>
A pointer to an NPVariant to receive the result returned by the default method.

Returns

true if the default method was successfully invoked, otherwise false. If the default method was invoked successfully, any return value is stored in the NPVariant specified by <tt>result</tt>.

When the caller no longer needs the <tt>result</tt>, it must call NPN_ReleaseVariantValue() to release it.

Description

The method arguments are passed as an array of NPVariants, and the number of arguments is passed in. The result of the method invocation is returned through an NPVariant result parameter. If the method invocation succeeds, NPN_Invoke() returns true, else false.

Document Tags and Contributors

标签:
Contributors to this page: Sheppy, Jst
最后编辑者: Sheppy,