jruby-win32ole icon indicating copy to clipboard operation
jruby-win32ole copied to clipboard

WIN32OLE.const_load should accept a string as its first argument for compatibility

Open johndouthat opened this issue 13 years ago • 0 comments

require 'win32ole'
module Constants
end
WIN32OLE.const_load("Microsoft Excel 12.0 Object Library", Constants)

Expected behavior: Some constants should be loaded into the Constants module, according to MRI's win32ole behavior. Actual behavior: NoMethodError: undefined method type_info' for "Microsoft Excel 12.0 Object Library"`

According to http://ruby-doc.org/stdlib-1.9.3/libdoc/win32ole/rdoc/WIN32OLE.html#method-c-const_load,

The first argument is WIN32OLE object or type library name.

MRI checks the class of the first argument here https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2817

johndouthat avatar Feb 02 '12 08:02 johndouthat