NPAPI 플러그인을 사용하여 Javascript를 통해 속성 값을 가져 오려고 할 때 문제가 있습니다. 디버깅하는 동안 모든 함수 체인 (HasProperty, HasMethod 및 GetProperty)이 호출되는 것을 볼 수 있습니다. GetProperty를 호출하는 동안 결과 매개 변수에 새 값을 설정한다는 것을 알았습니다. 그러나 GetProperty를 떠나면 예외가 발생하고 그 이유를 이해할 수 없습니다.자바 스크립트에서 NPAPI 플러그인의 속성에 액세스합니다.
FireFox에서 초기화하는 것을 잊어 버린 추가 기능을 호출 할 수 있습니까? 사전에
감사
내 코드는 다음과 같습니다
// static function which calls Get_Property for the instance of CScriptableNPObject
bool CScriptableNPObject::NP_GetProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
{
m_Logs.WriteLogs(10, _T("Enter the CScriptableNPObject::NP_GetProperty()"));
return ((CScriptableNPObject *)npobj)->GetProperty(name, result);
}
// just converter name from NPIdentifier to char *
bool CScriptableNPObject::GetProperty(NPIdentifier name, NPVariant *result)
{
NPUTF8 *pszProperty = m_pNPNFuncs->utf8fromidentifier(name);
return GetProperty(pszProperty, result);
}
// checking the dictionary of properties, if property exists put its value into the result
bool CScriptableNPObject::GetProperty(NPUTF8 *pszProperty, NPVariant *result)
{
VOID_TO_NPVARIANT(*result);
JSPropertiesMap::iterator it = m_JSProperties.find(pszProperty);
if (it == m_JSProperties.end())
return false;
NPUTF8 *pszNewPropertyValue = new NPUTF8[it->second->value.stringValue.UTF8Length + 1];
sprintf(pszNewPropertyValue, it->second->value.stringValue.UTF8Characters);
STRINGZ_TO_NPVARIANT(pszNewPropertyValue, *result);
return true;
}
없음 코드 샘플, 아니 세부 사항을 어떤 시도되었습니다 ... 아니, 우리가 당신을 도울 수 있다고 생각하지 않습니다. 아마도 좀 더 자세한 정보를 추가했다면? – taxilian
기능 체인을 제공했습니다 – pimanych