error:errorcalling on什么意思mettodonnpobject

c++ - Scriptable plugin: Error calling method on NPObject - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I am getting a JavaScript error: Error calling method on NPObject when calling a method in my NPAPI plugin in Chrome & Firefox on XP. Running the same code on Windows 7 with the same browsers was successful.
I have built a Scriptable plugin using the NPAPI, so far I can debug into the Invoke method of my scriptable object. But I don't believe I have any control after it's finished.
Does anyone have any ideas? Is this an issue only in Windows XP?
bool MY_ScriptableObject::Invoke(NPObject*
NPIdentifier
const NPVariant* args,
NPVariant*
wptr = NULL;
wptr = NULL;
(name == NPN_GetStringIdentifier("getVersion"))
wptr = (NPUTF8*)NPN_MemAlloc(strlen("version:1.0.1") + 1); //Should be freed by browser
(wptr != NULL)
memset(wptr,
strlen("version:1.0.1")+1);
memcpy(wptr,
"version:1.0.1",
strlen("version:1.0.1"));
STRINGZ_TO_NPVARIANT(wptr,
return (rc);
Here is the HTML function that I am executing:
function Version()
var plugin = document.getElementById("plugin");
if (plugin == undefined)
alert("plugin failed");
var text = plugin.getVersion();
//Error happens at this line
alert(text);
67.6k14142193
The (sarcasm)awesome(/sarcasm) thing about NPAPI in current versions of the browsers is that if anything goes wrong with the call you automatically get that error message, even if the plugin has otherwise tried to set an exception with NPN_SetException.
My first guess would be that you compiled your code targeting a later version of windows than windows XP; I'm not sure if that would produce this issue or not.
I have never seen the issue you're describing, and I've got plugins running on xp, vista, and 7 with no trouble. You might also try playing with a
plugin and see if the issue occurs there or not.
I would recommend that you attach with a debugger and set some breakpoints. Start in NPN_GetValue and make sure that it's instantiating your NPObject, then set breakpoints in your NPObject's HasMethod and Invoke methods and see what is hit.
Likely something in there will show you what is actually happening, or at least tell you what code is or isn't getting hit.
11.9k21847
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled5313人阅读
Flash(9)
一般情况你可以先添加以下几句试试:
Security.allowDomain(&*&);
Security.allowInsecureDomain(&*&);
如果还未解决,那就剩下Flash里面有什么语句无法执行下去,经常是
某些变量没有初始化,如Array为null。。。。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:11351次
排名:千里之外
(1)(1)(3)(1)(6)当前位置: &
求翻译:Error calling method on NPObject是什么意思?
Error calling method on NPObject
问题补充:
上npobject错误调用方法
错误在npobject调用方法
错误在NPObject叫方法
在 NPObject 上的错误调用方法
NPObject 上的错误呼唤方法
我来回答:
参考资料:
* 验证码:
登录后回答可以获得积分奖励,并可以查看和管理所有的回答。 |
我要翻译和提问
请输入您需要翻译的文本!

我要回帖

更多关于 calling on什么意思 的文章

 

随机推荐