[Win32utils-devel] OLE, properties and methods

Heesob Park phasis at gmail.com
Mon Aug 10 21:15:10 EDT 2009


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]

Regards,

Park Heesob


More information about the win32utils-devel mailing list