[Win32utils-devel] OLE, properties and methods

Daniel Berger djberg96 at gmail.com
Tue Aug 11 10:22:40 EDT 2009



> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel-
> bounces at rubyforge.org] On Behalf Of Heesob Park
> Sent: Monday, August 10, 2009 7:15 PM
> To: Development and ideas for win32utils projects
> Subject: Re: [Win32utils-devel] OLE, properties and methods
> 
> Hi,
> 
> 2009/8/11 Daniel Berger <djberg96 at gmail.com>:
> > Hi,
> >
> > With win32ole is there a way to list the available properties or
> methods of
> > an OLE object?
> >
> > For example, with win32-sapi, the SpAudioFormat object has two
> properties
> > (Guid and Type) and two methods (GetWaveFormatEx, SetWaveFormatEx).
> How do I
> > list them?
> >
> Do you want this?
> 
> irb(main):001:0> require "win32/sapi5"
> => true
> irb(main):002:0> include Win32
> => Object
> irb(main):003:0> s = SpAudioFormat.new
> => #<Win32::SpAudioFormat:0x338a36c>
> irb(main):004:0> s.ole_get_methods
> => [Type, Guid]
> irb(main):005:0> s.ole_methods
> => [QueryInterface, AddRef, Release, GetTypeInfoCount, GetTypeInfo,
> GetIDsOfName
> s, Invoke, Type, Type, Guid, Guid, GetWaveFormatEx, SetWaveFormatEx,
> GetTypeInfo
> Count, GetTypeInfo, GetIDsOfNames, Invoke]
> irb(main):006:0> s.ole_func_methods
> => [QueryInterface, AddRef, Release, GetTypeInfoCount, GetTypeInfo,
> GetIDsOfName
> s, Invoke, GetWaveFormatEx, SetWaveFormatEx, GetTypeInfoCount,
> GetTypeInfo, GetI
> DsOfNames, Invoke]
> irb(main):007:0> s.ole_put_methods
> => [Type, Guid]

Thanks. I just realized that the latest 1.8.6p-368 actually has
documentation for win32ole.c embedded in it now.

I'm not a fan of the method names they chose. I might put in some aliases in
pr-win32ole. :)

Regards,

Dan



More information about the win32utils-devel mailing list