Re: IDocHostUIHandler GetExternal question
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 17 Oct 2007 18:45:57 -0400
eselk@xxxxxxxxxxxx wrote:
If I implement IDocHostUIHandler::GetExternal, can the IDispatch
object I return, have methods that return other IDispatch objects, and
can objects from JavaScript be passed as parameters as well?
Yes and yes.
So in JavaScript I would do something like this:
obj = window.external.createMyObject();
obj.DoSomething();
Quite possible.
Does JavaScript just treat all objects as IDispatch
Yes.
how does
it know what type of object/variable the "createMyObject" function
returned?
It doesn't know nor care.
Well, I guess I might know the answer to that, since COM
uses variant params, and my Invoke function sets the variant type that
it returns... I guess that is how JavaScript knows the variable type,
right?
Well, that's how it distinguishes an object from a primitive value like
an integer or a string. But all objects look the same to it (stored in
VARIANT of type VT_DISPATCH).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- IDocHostUIHandler GetExternal question
- From: eselk
- IDocHostUIHandler GetExternal question
- Prev by Date: IDocHostUIHandler GetExternal question
- Next by Date: scrolling in an IE add-on
- Previous by thread: IDocHostUIHandler GetExternal question
- Next by thread: scrolling in an IE add-on
- Index(es):
Relevant Pages
|
Loading