Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- From: "Lady_A" <alexandra.lev@xxxxxxxxx>
- Date: 11 Jan 2007 09:36:23 -0800
Hi,
I've hooked into the onunload event of IHTMLWindowEvents2 which has the
IHTMLEventObj as an in param.
My goal is to retrieve the URL of that window that triggered my
onunload.
The following code results in event_source beung NULL, meaning the
srcElement of the HTMLEventObj is NULL.
HRESULT __stdcall onunload(/*IHTMLEventObj*/IDispatch* disp_evt)
{
if (disp_evt) {
CComQIPtr<IHTMLEventObj> event_obj(disp_evt);
if (event_obj) {
CComQIPtr<IHTMLElement> event_source;
HRESULT hr = event_obj->get_srcElement(&event_source);
.....
}
}
}
Why is that ?
How do I retrieve the URL from my onunload sink ?
.
- Follow-Ups:
- Re: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- From: Igor Tandetnik
- Re: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- Prev by Date: Re: ReadyState property
- Next by Date: Re: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- Previous by thread: ReadyState property
- Next by thread: Re: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- Index(es):
Relevant Pages
|