i´m trying out the npruntime-scriptable-plugin with VC2010-Express.
Firefox without plugin-container.
Sample Scriptable Plug-in
results go here:
NPN_Evaluate() test, document = [object HTMLDocument]
function bar([object Window]) called!
Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120407 Firefox/11.0
Firefox with plugin-container
Sample Scriptable Plug-in
results go here:
function bar([object Window]) called!
Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120407 Firefox/11.0
missing the Line
NPN_Evaluate() test, document = [object HTMLDocument]
That´s important because the default loading a plugin is with plugin-container enabled. What´s going wrong?
2.) The plugin crashes (Firefox closes) using------------------
modules/plugin/sdk/samples/npruntime/plugin.cpp author Josh Aas Mon Nov 23 13:57:27 2009 -0500 (at Mon Nov 23 13:57:27 2009 -0500)
static LRESULT CALLBACK PluginWinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
745 {
746 switch (msg) {
747 case WM_PAINT:
...
756 if(p) {
757 if (p->m_String[0] == 0) {
758 strcpy("foo", p->m_String);
759 }
760
761 DrawText(hdc, p->m_String, strlen(p->m_String), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
I change the Line 758 to
strcpy_s(p->m_String, 3+1, "foo");
If the version string is empty Firefox don´t crash. Is this change/ Code OK ?