module Fzeet::Windows::COM::Helpers
Public Instance Methods
QueryInstance(klass) { |instance;| ... }
click to toggle source
# File lib/fzeet/windows/com/Common.rb, line 124 def QueryInstance(klass) instance = nil FFI::MemoryPointer.new(:pointer) { |ppv| QueryInterface(klass::IID, ppv) instance = klass.new(ppv.read_pointer) } begin yield instance; return self ensure instance.Release end if block_given? instance end
UseInstance(klass, name, *args) { |instance = klass| ... }
click to toggle source
# File lib/fzeet/windows/com/Common.rb, line 142 def UseInstance(klass, name, *args) instance = nil FFI::MemoryPointer.new(:pointer) { |ppv| send(name, *args, klass::IID, ppv) yield instance = klass.new(ppv.read_pointer) } self ensure instance.Release if instance end