Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OleEvent
OleEvent [message #443365] Thu, 23 September 2004 17:54
Eclipse UserFriend
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!
Previous Topic:Table UI artifacts with ProgressBar
Next Topic:TableTreeViewer - Add Drag Support
Goto Forum:
  


Current Time: Thu Apr 25 22:12:47 GMT 2024

Powered by FUDForum. Page generated in 0.02351 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top