Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:03:21+00:00 2026-05-27T12:03:21+00:00

Backgound steps Used Mozilla code from here: http://mxr.mozilla.org/seamonkey/source/modules/plugin/tools/sdk/samples/basic/windows/ New Empty Project in Visual Studio

  • 0

Backgound steps

  1. Used Mozilla code from here: http://mxr.mozilla.org/seamonkey/source/modules/plugin/tools/sdk/samples/basic/windows/
  2. New Empty Project in Visual Studio & added above files
  3. Changed Congfiguration Type : Dynamic Library (.dll)
    3b. Linker->Input->Module Definition File: BasicPlugin.def
  4. Commented BasicPlugin.cpp, to only have basic functions and disply a MessageBox for Hello World
  5. Compile (successfull) & copied to Firefox Plugins directory
  6. Checked about:plugins (found)
  7. Load HTML to call dll (failed)

I am trying to use the npruntime files now and make a scriptible plugin (not sure how). But I dont understand why the plugin doesnt get loaded. This seems the basic of all basic. Any one have ideas on this?

BasicPlugin.cpp

#include "BasicPlugin.h"

NPError NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
{
MessageBox(NULL,"Hello World","NP_Initialize",MB_OK);

  // Check the size of the provided structure based on the offset of the last member we need.
  pFuncs->newp = NPP_New;
  pFuncs->destroy = NPP_Destroy;
  pFuncs->setwindow = NPP_SetWindow;
  pFuncs->newstream = NPP_NewStream;
  pFuncs->destroystream = NPP_DestroyStream;
  pFuncs->asfile = NPP_StreamAsFile;
  pFuncs->writeready = NPP_WriteReady;
  pFuncs->write = NPP_Write;
  pFuncs->print = NPP_Print;
  pFuncs->event = NPP_HandleEvent;
  pFuncs->urlnotify = NPP_URLNotify;
  pFuncs->getvalue = NPP_GetValue;
  pFuncs->setvalue = NPP_SetValue;

  return NPERR_NO_ERROR;
}

//NP_EXPORT(char*) NP_GetPluginVersion()
//{return PLUGIN_VERSION;}

//NP_EXPORT(const char*) NP_GetMIMEDescription()
//{return "application/basic-plugin:bsc:Basic plugin";}

NPError NP_GetValue(void* future, NPPVariable aVariable, void* aValue) 
{return NPERR_NO_ERROR;}

NPError OSCALL  NP_Shutdown()
{return NPERR_NO_ERROR;}

NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) 
{
MessageBox(NULL,"Hello World","NPP_New",MB_OK);
return NPERR_NO_ERROR;
}

NPError NPP_Destroy(NPP instance, NPSavedData** save) 
{return NPERR_NO_ERROR;}

NPError NPP_SetWindow(NPP instance, NPWindow* window) 
{
MessageBox(NULL,"Hello World","NPP_SetWindow",MB_OK);
return NPERR_NO_ERROR;
}

NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) 
{return NPERR_GENERIC_ERROR;}

NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) 
{return NPERR_GENERIC_ERROR;}

int32_t NPP_WriteReady(NPP instance, NPStream* stream) 
{return 0;}

int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) 
{return 0;}

void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) {}

void NPP_Print(NPP instance, NPPrint* platformPrint)  {}
int16_t NPP_HandleEvent(NPP instance, void* event) 
{return 1;}

void NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData)  {}

NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) 
{return NPERR_GENERIC_ERROR;}

NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) 
{return NPERR_GENERIC_ERROR;}

HTML

<html>
 <body>
  <center><h1>Basic Plugin Example for Mozilla Test Case</h1></center>
  This test case is to demonstrate the Basic Plugin example. You should get a message box saying Hello World.
  <br><br>
  <center><embed type="application/basic-plugin" border=1 width=600 height=40></center>
 </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:03:22+00:00Added an answer on May 27, 2026 at 12:03 pm

    If you’re trying to run this on windows then it won’t work; you have the wrong entrypoints for windows. The ones you have listed are the entrypoints for linux. See https://github.com/firebreath/FireBreath/blob/master/src/PluginAuto/Win/np_winmain.cpp for FireBreath’s windows entrypoints file; also explained in http://npapi.com/tutorial

    Edit

    Hypothetically there could be lots of other things; without seeing your whole project it’s hard to speculate. It’s showing up in about:plugins, so your strings resources are in place. Are you exporting the symbols correctly with your .def file? Does DllMain get called? (don’t use a messagebox there, just log something or set a breakpoint)

    Again, FireBreath is (aside from being a much easier way to create a NPAPI plugin) an example of creating a fully functioning npapi plugin; you may learn a lot from looking at it. If none of that works I couldn’t begin to speculate without seeing your whole project; maybe as a github project or something?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

< backgound> I'm at a point where I really need to optimize C++ code.
I'm from PHP background. I used to use Apache, MySQL and PHP for web
I used AVQueuePlayer to play several items in background. And code worked perfect in
Background I admit, this question stems from an ultimate lack of deep understanding of
I have been receiving reports from customers in the field that my app is
I know this isn't exactly how the pickle module was intended to be used,
this is my first post here. First off, some background, I'm new to C#
Does anyone knows, how to code in c# to stop/pause the zune music in
The problem: On top of existing UIView, load a background image From the card
I used an example I found online to create a custom grid control. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.