tags:

views:

140

answers:

0

Hi,

I have the following code in my npapi plugin:

 NPIdentifier idcreate = NPN_GetStringIdentifier("createElement");
 NPVariant ret;
 VOID_TO_NPVARIANT(ret);
 NPVariant arg;
 STRINGZ_TO_NPVARIANT("div",arg);
 bool result = NPN_Invoke(instance(), NPVARIANT_TO_OBJECT(doc),
                          idcreate, &arg, 1, &ret);

The return from the NPN_Invoke call is always false and the value of ret is null. In the above code, doc is obtained using GetProperty from the window object. doc is not null.

Any help regarding what i am doing wrong or what could be going wrong would be really useful.

Thanks