Subj : Re: Corrected Re: Ignore the other one To : netscape.public.mozilla.jseng From : "Izman" Date : Tue Sep 16 2003 08:58 pm Thank you again. I figured out that the code below works, just not in the app I placed it into. I created a new project that is dialog based and placed a single button on the dialog box. I then placed the code below into the app and attached it to the button so that when the button is pressed it runs a predefined javascript file. The code below works in the new app, which says to me that something is amiss with the original app I am trying to embed the code into. This appears to not be a javascript engine issue or any code around the engine, so I will try and figure out what is wrong with the original app I was embedding the javascript engine into. Thank you again for all your help. "Brendan Eich" wrote in message news:3F67390F.1050600@meer.net... > Izman wrote: > > >Thank you for your help Brendan. I am using the win32 debug build of > >js-1.5-rc5a.tar.gz file downloaded from ftp://ftp.mozilla.org/pub/js/. I tried using the win32 release build but it crashes my app every time I try and use a script, even though the app and js32.dll compile with no errors or warnings. I use VS6 and compile through the IDE. > > > > You need to link with /OPT:NOICF -- see bug > http://bugzilla.mozilla.org/show_bug.cgi?id=151066 and the release > notes. This is necessary to work around a bug in MSVC that bites RC5 > and RC5a. > > >Added error checking to the constructor and set rval to the obj: > >JSBool JSMyObject::JSConstructor(JSContext *cx, JSObject *obj, > > uintN argc, jsval *argv, jsval *rval) > >{ > > JSMyObject *p = new JSMyObject(); > > > > if (!p) > > return JS_FALSE; > > > > > > Aside: You'll want to JS_ReportOutOfMemory(cx) before returning false if > (!p). > > I'm not sure why the second property is not being defined correctly. > Could you send me the full code (including the JS and the C++), or the > code for a reduced but complete testcase, so I can debug it? > Alternatively, can you run a debugger on your embedding application and > try to see what is going wrong? > > /be > .