D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
WIN32OLE
/
Filename :
cdesc-WIN32OLE.ri
back
Copy
U:RDoc::NormalClass[iI" WIN32OLE:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ : @fileI"!ext/win32ole/lib/win32ole.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"*ext/win32ole/lib/win32ole/property.rb;T; 0o;;[o:RDoc::Markup::Paragraph;[I"@+WIN32OLE+ objects represent OLE Automation object in Ruby.;To:RDoc::Markup::BlankLine o;;[I"BBy using +WIN32OLE+, you can access OLE server like VBScript.;T@o;;[I"Here is sample script.;T@o:RDoc::Markup::Verbatim;[I"require 'win32ole' ;TI" ;TI"/excel = WIN32OLE.new('Excel.Application') ;TI"excel.visible = true ;TI"'workbook = excel.Workbooks.Add(); ;TI")worksheet = workbook.Worksheets(1); ;TI"Gworksheet.Range("A1:D1").value = ["North","South","East","West"]; ;TI"1worksheet.Range("A2:B2").value = [5.2, 10]; ;TI"&worksheet.Range("C2").value = 8; ;TI"'worksheet.Range("D2").value = 20; ;TI" ;TI"'range = worksheet.Range("A1:D2"); ;TI"range.select ;TI""chart = workbook.Charts.Add; ;TI" ;TI"workbook.saved = true; ;TI" ;TI"$excel.ActiveWorkbook.Close(0); ;TI"excel.Quit(); ;T:@format0o;;[ I"FUnfortunately, +WIN32OLE+ doesn't support the argument passed by ;TI"reference directly. ;TI"NInstead, +WIN32OLE+ provides WIN32OLE::ARGV or WIN32OLE::Variant object. ;TI"JIf you want to get the result value of argument passed by reference, ;TI"5you can use WIN32OLE::ARGV or WIN32OLE::Variant.;T@o; ;[I")oleobj.method(arg1, arg2, refargv3) ;TI"Qputs WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method ;T;0o;;[I"or;T@o; ;[ I"+refargv3 = WIN32OLE::Variant.new(XXX, ;TI"H WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_XXX) ;TI")oleobj.method(arg1, arg2, refargv3) ;TI"Ip refargv3.value # the value of refargv3 after called oleobj.method.;T;0; I"ext/win32ole/win32ole.c;T; 0; 0; 0[ [U:RDoc::Constant[i I"VERSION;TI"WIN32OLE::VERSION;T:public0o;;[o;;[I" Version string of WIN32OLE.;T; @F; 0@F@cRDoc::NormalClass0U;[i I" ARGV;TI"WIN32OLE::ARGV;T;0o;;[o;;[I"IAfter invoking OLE methods with reference arguments, you can access ;TI"*the value of arguments by using ARGV.;T@o;;[I"EIf the method of OLE(COM) server written by C#.NET is following:;T@o; ;[I"-void calcsum(int a, int b, out int c) { ;TI" c = a + b; ;TI"} ;T;0o;;[I"Dthen, the Ruby OLE(COM) client script to retrieve the value of ;TI";argument c after invoking calcsum method is following:;T@o; ;[I"a = 10 ;TI"b = 20 ;TI"c = 0 ;TI" comserver.calcsum(a, b, c) ;TI"p c # => 0 ;TI"(p WIN32OLE::ARGV # => [10, 20, 30] ;T;0o;;[I"MYou can use WIN32OLE::Variant object to retrieve the value of reference ;TI"3arguments instead of referring WIN32OLE::ARGV.;T; @F; 0@F@@R0U;[i I"CP_ACP;TI"WIN32OLE::CP_ACP;T;0o;;[o;;[I"BANSI code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I" CP_OEMCP;TI"WIN32OLE::CP_OEMCP;T;0o;;[o;;[I"AOEM code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I" CP_MACCP;TI"WIN32OLE::CP_MACCP;T;0o;;[o;;[I"2;T; @F; 0@F@@R0U;[i I"CP_THREAD_ACP;TI"WIN32OLE::CP_THREAD_ACP;T;0o;;[o;;[I">current thread ANSI code page. See WIN32OLE.codepage and ;TI"WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I"CP_SYMBOL;TI"WIN32OLE::CP_SYMBOL;T;0o;;[o;;[I"Dsymbol code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I"CP_UTF7;TI"WIN32OLE::CP_UTF7;T;0o;;[o;;[I"CUTF-7 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I"CP_UTF8;TI"WIN32OLE::CP_UTF8;T;0o;;[o;;[I"CUTF-8 code page. See WIN32OLE.codepage and WIN32OLE.codepage=.;T; @F; 0@F@@R0U;[i I"LOCALE_SYSTEM_DEFAULT;TI"$WIN32OLE::LOCALE_SYSTEM_DEFAULT;T;0o;;[o;;[I"Bdefault locale for the operating system. See WIN32OLE.locale ;TI"and WIN32OLE.locale=.;T; @F; 0@F@@R0U;[i I"LOCALE_USER_DEFAULT;TI""WIN32OLE::LOCALE_USER_DEFAULT;T;0o;;[o;;[I"Adefault locale for the user or process. See WIN32OLE.locale ;TI"and WIN32OLE.locale=.;T; @F; 0@F@@R0[ [[I" class;T[[;[[I" codepage;TI"ext/win32ole/win32ole.c;T[I"codepage=;T@�[I"connect;T@�[I"const_load;T@�[I"create_guid;T@�[I"locale;T@�[I"locale=;T@�[I"new;T@�[I" ole_free;T@�[I"ole_reference_count;T@�[I"ole_show_help;T@�[:protected[ [:private[ [I" instance;T[[;[[I"[];T@�[I"[]=;T@�[I"_getproperty;T@�[I"_invoke;T@�[I"_setproperty;T@�[I" each;T@�[I"invoke;T@�[I"method_missing;T@�[I"methods;TI"!ext/win32ole/lib/win32ole.rb;T[I"ole_activex_initialize;T@�[I" ole_free;T@�[I"ole_func_methods;T@�[I"ole_get_methods;T@�[I"ole_method;T@�[I"ole_method_help;T@�[I"ole_methods;T@�[I"ole_obj_help;T@�[I"ole_put_methods;T@�[I"ole_query_interface;T@�[I"ole_respond_to?;T@�[I" ole_type;T@�[I"ole_typelib;T@�[I"setproperty;T@�[;[ [;[[I"ole_methods_safely;T@�[ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[@ @@F@FcRDoc::TopLevel