mozilla

Revision 119523 of NP_Initialize

  • Revision slug: NP_Initialize
  • Revision title: NP_Initialize
  • Revision id: 119523
  • Created:
  • Creator: Demos
  • Is current revision? Yes
  • Comment 8 words added
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( { "fr": "fr/NP_Initialize", "ja": "ja/NP_Initialize" } ) }}

Revision Source

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

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

NPError NP_Initialize(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *aNPPFuncs)
</pre>
<h3 id="Returns" 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" title="en/NPAPI/Constants#Error_Codes">Error Codes</a>.</li>
</ul>
<h3 id="Description" 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 id="See_Also" name="See_Also">See Also</h3>
<p>{{ Npapi("NP_Shutdown") }}, {{ Npapi("NPP_New") }}</p>
<p>{{ languages( { "fr": "fr/NP_Initialize", "ja": "ja/NP_Initialize" } ) }}</p>
Revert to this revision