Subj : Re: C embedding question: failure in JS_DefineFunction To : netscape.public.mozilla.jseng From : "Pavel Podgoretsky" Date : Tue Mar 18 2003 12:42 pm Hi Brendan, Sorry I wasn't specific enough. FindConstructor returns null, which is propagated up the stack and eventually JS_DefineFunction returns null. There are no other errors. BUT while I was writing up a few more details for you, I found the problem! Thank you! :) The JSClass structure that I use needs a getObjectOps member (countrary to what the api docs say!), and that member has to return a non-null JSObjectOps. [There is an access violation otherwise.] Since I didn't know what some of those should do, I just had them return JS_FALSE. At some point, lookupProperty was called [looking for 'Function', for some strange to me reason] and returned JS_FALSE instead of setting its outparams to null and returning JS_TRUE. (If I recall correctly, the very helpful comments in jspubtd.h were not as helpful when I wrote that code originally...) Thank you for your extremely prompt response. -Pavel .