Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created May 20, 2010 16:59
Show Gist options
  • Save phiggins/407804 to your computer and use it in GitHub Desktop.
Save phiggins/407804 to your computer and use it in GitHub Desktop.
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