OleEvent [message #443365] |
Thu, 23 September 2004 17:54 |
Eclipse User |
|
|
|
Originally posted by: jay.kurant.com
Is there a way to get the OleAutomation object used to capture an event
from within the OleListenter.handlerEvent() method?
I am embedding IE in a control and I want to capture information when a
user clicks a link. I can successfully embed the control and find all the
links on the page. I then add the event sink with:
OleAutomation oleLink = varLink.getAutomation();
m_oleControlSite.addEventListener(oleLink, 0xfffffda8, new
BrowserLinkListener());
My listener class looks like:
public class BrowserLinkListener implements OleListener {
public void handleEvent(OleEvent event) {
System.out.println("in event");
}
}
Within BrowserLinkListener.handlerEvent(), event.widget contains a
reference to m_oleControlSite. In the sink, when this method is being
called from, the IUnknown to oleLink is stored. Is there a way to get this
IUnknown back? I know I could pass it into the constructor of the
listener class, but since the sink is already holding onto it, I would
much rather get it from the sink.
Also, do I need to keep track of all the event listeners I add, like in
the above code, and call removeEventListener for each one? Or will they
get removed automagically when another document gets loaded in the control
(this is probably IE specific, but embedding IE seems like a popular thing
to do from the questions on this list)?
Thanks for any guidance you can give!
|
|
|
Powered by
FUDForum. Page generated in 0.02351 seconds