Getting a pointer to the Script's IDispatch when called from WSH?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi All,
I was looking at this article on IDispatchEx :
http://msdn2.microsoft.com/EN-US/library/sky96ah7.aspx
and while it is quite useful - my one question is this:
My COM object needs to get a IDispatchEx* to the global script object
such as seems to be passed into 'test(IDispatchEx *pdexScript)'.
My script is being hosted by WSH, and not IE. Is there anyway to get
access to this without actually having to pass it in?

I am hoping that there is some way within my method that i can do
this:

STDMETHODIMP MyComObj::makeJSObject(IDispatch** retval)
{
IDispatchEx* pdexScript = GetCurrentActiveScriptDispatch();
...

}

Please let me know if you have any ideas on how to get a hold of the
global script IDispatch* without having to explicitly pass it in from
the script or if you could point me to the right newsgroup, if this is
not it :)

Thanks in advance!

Faisal Vali, MD, MSc
Radiation Oncology
Loyola
.