Bug #2618
Win32OLE RuntimeError due CoInitialize not being called
Description
=begin
A user reported to Ruby-Talk and RubyInstaller mailing list some issues using ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
http://groups.google.com/group/rubyinstaller/browse_thread/thread/e5e47aabf09aff98
I could reproduce the issue across multiple versions of 1.9.1 and with close-up-to-date version of 1.9.2dev:
http://groups.google.com/group/rubyinstaller/msg/dae727305e57ba6d
Simple test script:
http://pastie.org/786354
require 'win32ole'
t = Thread.new do
begin
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
t.join
Generates this:
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32]
WIN32OLERuntimeError
failed to create WIN32OLE object from InternetExplorer.Application'
initialize'
HRESULT error code:0x800401f0
CoInitialize has not been called.
t.rb:5:in
t.rb:5:in new'
block in '
t.rb:5:in
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32]
WIN32OLERuntimeError
failed to create WIN32OLE object from InternetExplorer.Application'
initialize'
HRESULT error code:0x800401f0
CoInitialize has not been called.
t.rb:5:in
t.rb:5:in new'
block in '
t.rb:5:in
ruby 1.9.2dev (2010-01-02 trunk 26229) [i386-mingw32]
WIN32OLERuntimeError
failed to create WIN32OLE object from InternetExplorer.Application'
initialize'
HRESULT error code:0x800401f0
CoInitialize has not been called.
t.rb:5:in
t.rb:5:in new'
block in '
t.rb:5:in
Both mswin32 and mingw32 generates the same issue.
=end
Related issues
Associated revisions
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: OLE uninitialize
- ext/win32ole/win32ole.c (ole_initialize): uninitialize OLE at thread ends. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
win32ole: remove win32ole.rb
- ext/win32ole/lib/win32ole.rb: no longer used. [Bug #2618] [ruby-core:27634]
History
Updated by usa (Usaku NAKAMURA) about 9 years ago
- Status changed from Open to Assigned
- Assignee set to suke (Masaki Suketa)
=begin
=end
Updated by suke (Masaki Suketa) about 9 years ago
=begin
Could you try ruby 1.9.2dev (2010-01-23 trunk 26383)?
I'm not sure fix this issue or not, but the script
works fine in my Windows XP.
I have tested cygwin ruby and mswin32 ruby.
=end
Updated by rogerdpack (Roger Pack) about 9 years ago
=begin
working all right for me with
ruby 1.9.2dev (2010-01-25 trunk 26409) [i386-mingw32]
(fails with ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mingw32])
=end
Updated by rogerdpack (Roger Pack) about 8 years ago
=begin
http://www.linuxbloke.com/2010/06/26/ever-tried-calling-a-win32ole-com-object-from-rubys-drb/ is also related, for followers.
=end
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Tracker changed from Backport to Bug
- Project changed from Backport191 to Ruby trunk
- Status changed from Assigned to Open
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38867.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
win32ole: OLE initialize per threads
- ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634]
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Description updated (diff)
- Status changed from Closed to Open
- % Done changed from 100 to 50
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Status changed from Open to Closed
- % Done changed from 50 to 100
win32ole: OLE initialize per threads
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e