NP_Initialize

  • Revision slug: NP_Initialize
  • Revision title: NP_Initialize
  • Revision id: 119521
  • Created:
  • Creator: Kazssym
  • Is current revision? No
  • Comment /* Syntax */ This function has different argument sets according to platforms.

Revision Content

{{wiki.template('Np-plugin-api')}}

Summary

Provides global initialization for a plug-in.

Syntax

Windows

#include <npapi.h>

NPError WINAPI NP_Initialize(NPNetscapeFuncs *aNPNFuncs)

Unix

#include <npapi.h>

NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)

Returns

  • If successful, the function returns NPERR_NO_ERROR.
  • If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes.

Description

The browser calls this function only once: when a plug-in is loaded, before the first instance is created. This is the first function that the browser calls. NP_Initialize tells the plug-in that the browser has loaded it and provides global initialization. Allocate any memory or resources shared by all instances of your plug-in at this time.

After the last instance of a plug-in has been deleted, the browser calls NP_Shutdown, where you can release allocated memory or resources.

See Also

NP_Shutdown, NPP_New

{{ wiki.languages( { "ja": "ja/NP_Initialize" } ) }}

Revision Source

<p>
</p><p>
{{wiki.template('Np-plugin-api')}}
</p>
<h3 name="Summary">Summary</h3>
<p>Provides global initialization for a plug-in.
</p>
<h3 name="Syntax"> Syntax </h3>
<h4 name="Windows"> Windows </h4>
<pre>#include &lt;npapi.h&gt;

NPError WINAPI NP_Initialize(NPNetscapeFuncs *aNPNFuncs)
</pre>
<h4 name="Unix"> Unix </h4>
<pre>#include &lt;npapi.h&gt;

NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)
</pre>
<h3 name="Returns">Returns</h3>
<ul><li> If successful, the function returns NPERR_NO_ERROR.
</li><li> If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see <a href="en/NPAPI/Constants#Error_Codes">Error Codes</a>.
</li></ul>
<h3 name="Description">Description</h3>
<p>The browser calls this function only once: when a plug-in is loaded, before the first instance is created. This is the first function that the browser calls. <code>NP_Initialize</code> tells the plug-in that the browser has loaded it and provides global initialization. Allocate any memory or resources shared by all instances of your plug-in at this time.
</p><p>After the last instance of a plug-in has been deleted, the browser calls <a href="en/NP_Shutdown">NP_Shutdown</a>, where you can release allocated memory or resources.
</p>
<h3 name="See_Also">See Also</h3>
<p><a href="en/NP_Shutdown">NP_Shutdown</a>, <a href="en/NPP_New">NPP_New</a>
</p>{{ wiki.languages( { "ja": "ja/NP_Initialize" } ) }}
Revert to this revision