The demo on chrome running Npruntime Demo,codeproject is for Firefox, and it's used on chrome to modify some of the code.
Required libraries: Windows Platform SDK and NPAPI SDK
Download the demo of Npruntime in CodeProject.
Compile-time
Missing header file npfunctions.h then found the Npapi SDK.
Not included windows.h so include a bit
np_getmimedescription method definition and SDK has conflicting
Char *np_getmimedescription () {return npp_getmimedescription ();}
Revision changed to
Const Char * np_getmimedescription () { return npp_getmimedescription ();}
Compile successfully, after debugging, found that the plugin failed to load.
After a multi-party search data, modified the following part of the code finally succeeded.
Modify Code
The Np_getentrypoints method inside
if sizeof (Nppluginfuncs)) return Nperr_invalid_functable_error;
The trace found that Chrome passed over the pfuncs->size to 80 and the actual defined Nppluginfuncs size was 84 so seriously did not pass. Comment Masking!
The Np_initialize method inside
if sizeof (Npnetscapefuncs)) return Nperr_invalid_functable_error;
Tracking found that Chrome passed over the pfuncs->size and actually defined the size of the Npnetscapefuncs, so seriously not pass. Comment Masking!
Within the Cplugin constructor
1 , &rval);
Throw exception when calling, Comment mask!
Do the above handle well debugging normal.
NPAPI with note One, run Npruntime demo in Chrome