FrontPage  Index  Search  Changes  Login

(Ruby)win32ole

require 'win32ole'


class WIN32OLE
	@const_defined = Hash.new

	def WIN32OLE.new_with_const(prog_id, const_name_space)
		result = WIN32OLE.new(prog_id)
		unless @const_defined[const_name_space] then
			WIN32OLE.const_load(result, const_name_space)
			@const_defined[const_name_space] = true
		end
		return result
	end
end

module FileSystemObject
	@instance = nil

	def FileSystemObject.instance
		unless @instance then
			@instance = WIN32OLE.new('Scripting.FileSystemObject')
		end
		return @instance
	end
end
Last modified:2010/06/17 11:09:32
Keyword(s):
References: