зеркало из https://github.com/github/ruby.git
* ext/win32ole/win32ole.c: modify document for WIN32OLE_RECORD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ee5edc5950
Коммит
a3f50234bc
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Jul 15 20:31:40 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* ext/win32ole/win32ole.c: modify document for WIN32OLE_RECORD.
|
||||||
|
|
||||||
Tue Jul 15 12:42:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
Tue Jul 15 12:42:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||||
|
|
||||||
* defs/default_gems: change version definition file of rake.
|
* defs/default_gems: change version definition file of rake.
|
||||||
|
|
|
@ -9164,6 +9164,42 @@ folevariant_set_value(VALUE self, VALUE val)
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Document-class: WIN32OLE_RECORD
|
||||||
|
*
|
||||||
|
* <code>WIN32OLE_RECORD</code> objects represents VT_RECORD OLE variant.
|
||||||
|
* Win32OLE returns WIN32OLE_RECORD object if the result value of invoking
|
||||||
|
* OLE methods.
|
||||||
|
*
|
||||||
|
* If COM server in VB.NET ComServer project is the following:
|
||||||
|
*
|
||||||
|
* Imports System.Runtime.InteropServices
|
||||||
|
* Public Class ComClass
|
||||||
|
* Public Structure Book
|
||||||
|
* <MarshalAs(UnmanagedType.BStr)> _
|
||||||
|
* Public title As String
|
||||||
|
* Public cost As Integer
|
||||||
|
* End Structure
|
||||||
|
* Public Function getBook() As Book
|
||||||
|
* Dim book As New Book
|
||||||
|
* book.title = "The Ruby Book"
|
||||||
|
* book.cost = 20
|
||||||
|
* Return book
|
||||||
|
* End Function
|
||||||
|
* End Class
|
||||||
|
*
|
||||||
|
* then, you can retrieve getBook return value from the following
|
||||||
|
* Ruby script:
|
||||||
|
*
|
||||||
|
* require 'win32ole'
|
||||||
|
* obj = WIN32OLE.new('ComServer.ComClass')
|
||||||
|
* book = obj.getBook
|
||||||
|
* book.class # => WIN32OLE_RECORD
|
||||||
|
* book.title # => "The Ruby Book"
|
||||||
|
* book.cost # => 20
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* WIN32OLE_RECORD#to_h #=> Ruby Hash object.
|
* WIN32OLE_RECORD#to_h #=> Ruby Hash object.
|
||||||
|
@ -9172,6 +9208,30 @@ folevariant_set_value(VALUE self, VALUE val)
|
||||||
* The keys of Hash object are member names of VT_RECORD OLE variable and
|
* The keys of Hash object are member names of VT_RECORD OLE variable and
|
||||||
* the values of Hash object are values of VT_RECORD OLE variable.
|
* the values of Hash object are values of VT_RECORD OLE variable.
|
||||||
*
|
*
|
||||||
|
* If COM server in VB.NET ComServer project is the following:
|
||||||
|
*
|
||||||
|
* Imports System.Runtime.InteropServices
|
||||||
|
* Public Class ComClass
|
||||||
|
* Public Structure Book
|
||||||
|
* <MarshalAs(UnmanagedType.BStr)> _
|
||||||
|
* Public title As String
|
||||||
|
* Public cost As Integer
|
||||||
|
* End Structure
|
||||||
|
* Public Function getBook() As Book
|
||||||
|
* Dim book As New Book
|
||||||
|
* book.title = "The Ruby Book"
|
||||||
|
* book.cost = 20
|
||||||
|
* Return book
|
||||||
|
* End Function
|
||||||
|
* End Class
|
||||||
|
*
|
||||||
|
* then, the result of WIN32OLE_RECORD#to_h is the following:
|
||||||
|
*
|
||||||
|
* require 'win32ole'
|
||||||
|
* obj = WIN32OLE.new('ComServer.ComClass')
|
||||||
|
* book = obj.getBook
|
||||||
|
* book.to_h # => {"title"=>"The Ruby Book", "cost"=>20}
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
fole_record_to_h(VALUE self)
|
fole_record_to_h(VALUE self)
|
||||||
|
@ -9184,6 +9244,31 @@ fole_record_to_h(VALUE self)
|
||||||
* WIN32OLE_RECORD#typename #=> String object
|
* WIN32OLE_RECORD#typename #=> String object
|
||||||
*
|
*
|
||||||
* Returns the type name of VT_RECORD OLE variable.
|
* Returns the type name of VT_RECORD OLE variable.
|
||||||
|
*
|
||||||
|
* If COM server in VB.NET ComServer project is the following:
|
||||||
|
*
|
||||||
|
* Imports System.Runtime.InteropServices
|
||||||
|
* Public Class ComClass
|
||||||
|
* Public Structure Book
|
||||||
|
* <MarshalAs(UnmanagedType.BStr)> _
|
||||||
|
* Public title As String
|
||||||
|
* Public cost As Integer
|
||||||
|
* End Structure
|
||||||
|
* Public Function getBook() As Book
|
||||||
|
* Dim book As New Book
|
||||||
|
* book.title = "The Ruby Book"
|
||||||
|
* book.cost = 20
|
||||||
|
* Return book
|
||||||
|
* End Function
|
||||||
|
* End Class
|
||||||
|
*
|
||||||
|
* then, the result of WIN32OLE_RECORD#typename is the following:
|
||||||
|
*
|
||||||
|
* require 'win32ole'
|
||||||
|
* obj = WIN32OLE.new('ComServer.ComClass')
|
||||||
|
* book = obj.getBook
|
||||||
|
* book.typename # => "Book"
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
fole_record_typename(VALUE self)
|
fole_record_typename(VALUE self)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче