google chrome - javascript arguments are messed up when passed to NPAPI plugin function -


i using simple npapi example https://github.com/mikma/npsimple.

when try pass arguments javascript npapi invoke function, parameters recieved npapi function garbage, though argument count passed correctly. following definition of function in trying print "args" array after converting them char*:

invoke(npobject* obj, npidentifier methodname, const npvariant *args, uint32_t argcount, npvariant *result) 

am missing here?

it hard tell you're trying based on have given us. specifically, smorgan requested, need know how trying convert args array char*.

you aware of how npvariant works? if it's string, npvariant type npvarianttype_string , need use both utf8characters member of npstring struct (which in turn part of npvariant union) , utf8length member, since string may or may not null terminated.

also, keep in mind depending on put in, may or may not valid make npvariant char*. if helps, great; if doesn't, please post contents of function in trying handle input specific javascript calls making. haven't given enough work give more guesses problem may having.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -