Created
May 20, 2010 16:59
-
-
Save phiggins/407804 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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