:idea: ~~刷新窗口的诡异问题~~

阅读:2523回复:1
2010-01-27 15:35
写私信
楼主#
有人知道NPN_GetProperty吗?我在
ScriptablePluginObject::Invoke
中使用的时候开始正常;但是若刷新页面调用就会失败:
下面是我的实现
bool rvd=NPN_GetProperty(mNpp, sWindowObj,sDocument_id, &docv);
    if(!rvd)
    {
	cout<<"NPN_GetProperty err.1..return\n";		
	return false;
    }


CPlugin::CPlugin(NPP pNPInstance) :m_pNPInstance(pNPInstance),m_pNPStream(NULL),m_bInitialized(false),m_pScriptableObject(NULL)
中使用
NPN_GetValue(m_pNPInstance, NPNVWindowNPObject, &sWindowObj);
sDocument_id = NPN_GetStringIdentifier("document");

在页面开始定义全局静态

static NPObject *sWindowObj;
static NPIdentifier sDocument_id;

有人知道是怎么回事吗????
2010-01-27 15:35
写私信
1楼#
static NPObject *sWindowObj;
static NPIdentifier sDocument_id;
找到问题了。把这2个定义到类里面作为成员变量就可以了
详细可看这个帖子

forums.mozillazine.org/viewtopic.php?f=27&t=1718695&p=8552485#p8552485