将整数/字符串从NPAPI插件返回到JavaScript(不使用FireBreath) [英] Return an integer/String from NPAPI plugin to JavaScript(Not using FireBreath)

查看:100
本文介绍了将整数/字符串从NPAPI插件返回到JavaScript(不使用FireBreath)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释一下示例吗...?
如何从NPAPI插件(不使用FireBreath )向JavaScript返回整数/字符串? 我搜索了很多..但是找不到相关的答案.

Could anyone please explain with a sample...?
How can I return an integer/String from NPAPI plugin(Not using FireBreath) to JavaScript? I searched a lot ..but can't get a relevant answer.

推荐答案

找到了解决方案.
从NPAPI插件返回字符串

Found a solution.
Returning a string from NPAPI plugin

char* npOutString = (char *)pNetscapefn->memalloc(strlen(StringVariable) + 1);

if (!npOutString) return false; strcpy(npOutString, StringVariable); STRINGZ_TO_NPVARIANT(npOutString, *result);

if (!npOutString) return false; strcpy(npOutString, StringVariable); STRINGZ_TO_NPVARIANT(npOutString, *result);

这篇关于将整数/字符串从NPAPI插件返回到JavaScript(不使用FireBreath)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆