나는 NPAPI의 최신 버전입니다. 나는 한 가지 문제에 직면한다. 내 플러그인에 , 일부 데이터를 C++에서 JavaScript로 반환해야합니다. 예, 콜백입니다. 하지만 콜백 스레드와 주 스레드는 별도의 스레드입니다. 그래서 NPN_PluginThreadAsyncCall을 사용하지만 문제는 해결할 수 없습니다. 콜백 할 때, 파이어 폭스가 추락했습니다 ... 아무도 도와 줄 수 있습니까?C++에서 JS 로의 콜백 문제
벨로우즈 코드가 콜백 스레드에 있습니다. 아무에게도 왜 추락했는지 말해 줄 수 있습니까?
npnfuncs->pluginthreadasynccall(instance,callBackfunc,(void*)pdata);
/////////////////////////////////////////////////////////////////////
void callBackfunc(void* arg)
{
NPObject *winobj;
npnfuncs->getvalue(instance,NPNVWindowNPObject,&winobj);
NPVariant handler;
NPIdentifier id1 = npnfuncs->getstringidentifier("MyTest".c_str());
npnfuncs->getproperty(instance, winobj, id1, &handler);
NPObject* handlerObj= NPVARIANT_TO_OBJECT(handler);
NPVariant prototype;
NPIdentifier id2 = npnfuncs->getstringidentifier("prototype");
npnfuncs->getproperty(instance, serviceHandlerObj, id2, &prototype);
NPObject* prototypeObj= NPVARIANT_TO_OBJECT(prototype);
NPIdentifier id = npnfuncs->getstringidentifier("fun".c_str());
NPVariant voidResponse;
int status=npnfuncs->invoke(instance,prototypeObj,id,args,argCount,&voidResponse);
return;
}
감사 안부 greatsea