module Unknownr::Windows::COM::Instance

Public Class Methods

[](iface) click to toggle source
# File lib/unknownr.rb, line 161
def self.[](iface)
        Class.new(iface) {
                send(:include, Helpers)

                def initialize(pointer)
                        self.pointer = pointer

                        @vtbl = self.class::VTBL.new(self[:lpVtbl])
                end

                attr_reader :vtbl

                self::VTBL.members.each { |name|
                        define_method(name) { |*args|
                                raise "#{self}.#{name} failed." if Windows.FAILED(result = @vtbl[name].call(self, *args)); result
                        }
                }
        }
end
new(pointer) click to toggle source
# File lib/unknownr.rb, line 165
def initialize(pointer)
        self.pointer = pointer

        @vtbl = self.class::VTBL.new(self[:lpVtbl])
end