[Win32utils-devel] Fwd: IUnknown COM from Ruby
billagee at gmail.com
Sat Oct 23 15:36:54 EDT 2010
On Tue, Oct 19, 2010 at 10:53 PM, Heesob Park <phasis at gmail.com> wrote:
> Because DbgEng is not a registered COM server, we cannot use WIN32OLE
> module for this case.
> And there is no easy way to do this using ruby.
> Anyway, here is a first trial:
I wanted to thank you guys for giving some attention to this topic. :)
The DbgEng problem sounds similar to a situation I was in recently - I
wanted to use Ruby to try out the new MS UI Automation COM client API on
This API has a lot of promise for doing UI automation tasks. But the COM
object at the heart of it (CUIAutomation) does not implement IDispatch, so I
found it cannot be used with Ruby WIN32OLE (and similar modules for other
In the end I was able to use Python and comtypes to successfully use the UIA
COM API (and incidentally, it looks like comtypes is also used by PyDbgEng).
But a pure Ruby solution would be really convenient. I was not able to get
a handle on how to quickly get comtypes-like behavior in Ruby - I guess a
fair amount of effort will be required to mimic comtypes.
The vtable/memcpy Ruby Win32::API code posted by Park looks like a nice
first step in that direction. :)
As an alternative to a pure-Ruby solution, I found that I could instantiate
and use an IUnknown COM object via a Ruby C++ extension. Ben - this might
be a workaround to investigate if you absolutely have to get something
I was able to build such an extension using both MSVC and the Ruby
DevKit/MinGW. However, the MinGW solution was more painful since it
required some header file tweaking, since MinGW did not yet have the UI
Automation headers from the Win7 SDK. (DbgEng may not pose the same problem
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the win32utils-devel