Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'win32ole'
# Also possible using Daniel Berger's excellent windows-pr gem.
require 'Win32API'
CoInitialize = Win32API.new('ole32', 'CoInitialize', 'P', 'L')
threads = []
3.times do
threads << Thread.new do
begin
CoInitialize.call( 0 )
ie = WIN32OLE.new( "InternetExplorer.Application" )
ie.visible = true
ie.navigate( "http://google.com" )
puts "OK"
rescue Exception => e
puts e.class
puts e
puts e.backtrace
end
end
end
threads.each {|t| t.join }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.