mozilla

Revision 119522 of NP_Initialize

  • Revision slug: NP_Initialize
  • Revision title: NP_Initialize
  • Revision id: 119522
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment
Tags: 

Revision Content

{{ 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 {{ Npapi("NP_Shutdown") }}, where you can release allocated memory or resources.

See Also

{{ Npapi("NP_Shutdown") }}, {{ Npapi("NPP_New") }}

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

Revision Source

<p> {{ 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 <code>NPERR_NO_ERROR</code>.
</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 {{ Npapi("NP_Shutdown") }}, where you can release allocated memory or resources.
</p>
<h3 name="See_Also">See Also</h3>
<p>{{ Npapi("NP_Shutdown") }}, {{ Npapi("NPP_New") }}
</p>{{ languages( { "ja": "ja/NP_Initialize" } ) }}
Revert to this revision