Subj : Re: unsigned long To : Thibaut From : Brendan Eich Date : Thu Apr 15 2004 10:42 am Thibaut wrote: > I don't know how to resolve this error, if someone can help ... lengthp is a > jsint like it's said in the api... ?! Read jsapi.h: [~/src/phoenix/mozilla/js/src]$ grep JS_GetArrayLength jsapi.h JS_GetArrayLength(JSContext *cx, JSObject *obj, jsuint *lengthp); The API docs may lie. Someone please fix 'em, I'm weary of it. > how can i convert a jsint (long) to unsigned long ? > > > /////////// my code /////////////////// > jsint lengthp; > if (!JS_GetArrayLength(cx, array_children,&lengthp)) > return JS_FALSE; > ///////////////////////////////////////////// > error C2664: 'JS_GetArrayLength' : cannot convert parameter 3 from 'long *' > to 'unsigned long *' You are using C++, apparently. It treats types as equivalent only if their names are equivalent. You need to pass the address of a jsuint length. Don't use jsint. /be .