<p>Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows?  </p>

<p>The links and examples on <a href="http://www.mozilla.org/projects/plugins/" rel="nofollow noreferrer">http://www.mozilla.org/projects/plugins/</a> are all old and inaccurate - the "NEW" link was added to the page in 2004.</p>

<p>The example could be anything, but I was thinking a plugin that lets JavaScript set the name and then displays "Hello {Name}".  To show 2-way communication, it could have a property that returns the full salutation.</p>

<p>Though not as important, it would be nice if the plugin would work in Chrome too.</p>

It's fairly simple to make a plugin using NPAPI.  The key header files you'll need from the Gecko distribution are npapi.h and npupp.h.  You'll export functions from your plugin DLL or shared library with the names NP_Initialize, NP_Shutdown, NP_GetMIMEDescription, and NP_GetValue, and you'll need to also fill in the symbol table given to you in the NP_Initialize call with handlers for all of the NPP functions.
The key functions to implement from that set are NPP_New and NPP_Destroy.  Those define the lifecycle of a plugin instance.  If you're going to handle a media file linked from an <object> or <embed>, you'll need to also deal with NPP_NewStream, NPP_WriteReady, NPP_Write, and NPP_DestroyStream as a way for your plugin to get the file's data from the browser.  There's plenty more in
the Gecko Plugin developer's guide
.