Subj : Re: Executing a line of C code in javascript To : netscape.public.mozilla.jseng From : David Bradley Date : Sun Aug 24 2003 11:21 pm Brendan Eich wrote: > David Bradley wrote: > Why not? Or, how not? I mean, tell me more. It's possible to hook up > arbitrary code, provided you know the C or C++ signature of the function > to call. XPConnect and COMConnect prove that. Right, but you need IDL or a typelib and he seemed to be talking C and not c++. I also may read in too much into the message, due to the responses he received from the comp.lang.javascript group and thought he didn't have control over the C code in question. And I was thinking along the lines of what Visual BASIC provides, in allowing a declaration that imports a native function and allows it to be called like a VB one. JS_DefineFunction will allow you to invoke a C function with the signature defined by the JS callback typedef. But I couldn't use that to call say the Sleep Win32 API function unless I created a small wrapper that would translate the jsval arguments to the integer needed by sleep. David Bradley .