How to determine supported dispinterfaces for WIN32OLE object?

W

Will Gwaltney

I'm using WIN32OLE_EVENT to set up some event handlers on various DHTML
elements in Internet Explorer, and I'm having a bit of trouble identifying
the right event dispinterfaces to use. The Microsoft online documentation
is less than helpful; they claim that you can use the HTMLElementEvents2
interface on most all the HTML elements you care about, but I'm getting the
following when I try:

interface not found
HRESULT error code:0x80004002
No such interface supported

Here's a code skeleton that outlines what I'm trying to do:

---------------- (snip) -----------------------

require 'win32ole'

ie = WIN32OLE.new('InternetExplorer.Application')
 
W

Will Gwaltney

Thanks for the reply, Graham. As near as I can tell, the page you mention
on the Microsoft site has *most* of the interfaces, but not all of them
(thanks, Microsoft...) I couldn't figure out which interfaces to use for
submit and reset buttons and a few others. So one of the things I've been
trying to figure out is how to get Ruby to tell me which interfaces a
particular element supports. I know the
IConnectionPointContainer::EnumConnectionPoints method in C++ will get me
that info, but I don't know how to call it from WIN32OLE. Things are
getting desperate; I might have to resort to using VB! :)

Will
 
P

Paul

Will, can I ask what you aredoing with these interfaces? Im working on
a new version of some code that we use to test web applications via
IEs OLE interface and DOM.
One of the things Im hoping to do is a script recorder, and these
events would be essential in letting me recoed a users actions

Thanks

Paul
 
W

Will Gwaltney

Hi Paul,

Funny you should ask! I'm doing pretty much the same thing you're
planning to do. I'm hoping to get permission to open-source my code in the
next week or so; I'll drop you a line when I do. The script recorder
certainly won't be finished then, but any help anyone wanted to give would
be most appreciated.

BTW, I think I've come up with a way to figure these interfaces out.
Unfortunately, it doesn't involve ruby. :-( I'm going to put together an
HTML page with all the controls I care about, then run it through a python
program that will output all the connection points for those controls. Then
I'll use the discovered interfaces in the ruby-based script recorder.
Python's COM support includes low-level stuff like QueryInterface that I
haven't been able to figure out with WIN32OLE. Any port in a storm, I
guess... :)

Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top