A
Axel
Hello, Rubyists!
I have an example program from a German book on Ruby here, using
win32ole:
require "win32ole"
dlg = WIN32OLE.new("MSComDlg.CommonDialog")
# den Datei-Filter setzen
dlg.filter = "Word documents (*.doc)|*.doc" +
"|All Files(*.*)|*.*"
dlg.filterIndex = 1
dlg.maxFileSize = 128
file = ""
dlg.showOpen
file = dlg.fileName
exit if file == ""
print "#{file} wurde selektiert"
When I run this (on Windows XP with the Windows Ruby installation
package 1.8.2-15), I get the following error:
C:/temp/bla.rb:3:in `initialize': Failed to create WIN32OLE object from
`MSComDlg.CommonDialog' (WIN32OLERuntimeError)
HRESULT error code:0x80040112
Class is not licensed for use from C:/temp/bla.rb:3:in `new'
from C:/temp/bla.rb:3
Any ideas what could cause the problem?
Kind regards! ------------- Axel <><
I have an example program from a German book on Ruby here, using
win32ole:
require "win32ole"
dlg = WIN32OLE.new("MSComDlg.CommonDialog")
# den Datei-Filter setzen
dlg.filter = "Word documents (*.doc)|*.doc" +
"|All Files(*.*)|*.*"
dlg.filterIndex = 1
dlg.maxFileSize = 128
file = ""
dlg.showOpen
file = dlg.fileName
exit if file == ""
print "#{file} wurde selektiert"
When I run this (on Windows XP with the Windows Ruby installation
package 1.8.2-15), I get the following error:
C:/temp/bla.rb:3:in `initialize': Failed to create WIN32OLE object from
`MSComDlg.CommonDialog' (WIN32OLERuntimeError)
HRESULT error code:0x80040112
Class is not licensed for use from C:/temp/bla.rb:3:in `new'
from C:/temp/bla.rb:3
Any ideas what could cause the problem?
Kind regards! ------------- Axel <><