distinguishing javascript functions, objects using atl



Not sure if this is the right group for this... feel free to suggest
another.

Is there a way to distinguish a jscript function object from other
jscript types, in ATL?

Some background:
I have a DOM containing a node of type IDispatchEx, for example
Root.SomeDispatchExObject.
This DOM is constructed in ATL, and automation compliant, so the
ActiveScript engine can access it.

In jscript I can attach any kinds of objects to this node, like so:

Root.SomeDispatchExObject.myString = "hello";
Root.SomeDispatchExObject.myNumber = 7;
Root.SomeDispatchExObject.callBack = function(){ doSomething(); }

and I can even run the callBack like this, as expected
Root.SomeDispatchExObject.callBack(); or
Root.SomeDispatchExObject.callBack.call();

Now, in ATL, after the jscript engine has run the script, I traverse
the whole DOM via IDispatch's GetTypeInfo api, and can see these new
objects.

What I want to do:
I want to be able to figure out from ATL that "callBack" is a function
object.

The problem is that when i call GetTypeAttr() on its IDispatchEx
object, it reveals 0 funcs. (the cFuncs and cVars fields of the
TYPEATTR struct are both 0).
I've tried QIing for JSGlobal::FunctionInstance, but that didn't work
either.
I've also tried GetIDsOfNames on the function "call" and then
"toString" (both of which, I believe, should be supported by jscript
objects) but that didn't work either.

Can anyone help?

thanks,

Eric

.



Relevant Pages

  • Cyclic references DOM <-> JScript
    ... The problem is cyclic references between DOM and JScript as following: ... But the memory leak is still present. ... JScript / DOM scripts, and I "cleanse" them all on window.onunload. ...
    (microsoft.public.scripting.jscript)
  • Re: HTA - Refresh
    ... Strictly speaking it is not Java (JScript), but rather a part of the ... browser's document object model (DOM) which is language independent. ... That is it can be used in JScript or VBS, if the browser supports ...
    (microsoft.public.scripting.vbscript)
  • Re: HTA - Refresh
    ... Strictly speaking it is not Java (JScript), but rather a part of the ... browser's document object model (DOM) which is language independent. ... That is it can be used in JScript or VBS, if the browser supports ...
    (microsoft.public.scripting.vbscript)
  • Re: IE 7.0
    ... is already fully supported (expect for a few bugs here and there) in JScript and hence IE, ... Most of the standards focus for IE 7 has been on support for the W3C CSS 2, hence changes to the IE DOM appear to realted to CSS rather than full compliance with the W3C DOM, e.g.: ...
    (comp.lang.javascript)
  • Re: Syntax question
    ... between JScript and javascript? ... No. DOM issues have nothing to do with the language. ... find the language references and the Event Object documentation: ... the language and the DOM are separate for each browser. ...
    (microsoft.public.scripting.jscript)