Class: Object
Relationships & Source Files | |
Inherits: | BasicObject |
Defined in: | ext/win32ole/win32ole_type.c, ext/win32ole/win32ole_event.c, ext/win32ole/win32ole_method.c, ext/win32ole/win32ole_param.c, ext/win32ole/win32ole_record.c, ext/win32ole/win32ole_typelib.c, ext/win32ole/win32ole_variable.c, ext/win32ole/win32ole_variant.c |
Constant Summary
-
WIN32OLE_EVENT =
WIN32OLE_EVENT
objects controls OLE event.cWIN32OLE_EVENT
-
WIN32OLE_METHOD =
WIN32OLE_METHOD
objects represent OLE method information.cWIN32OLE_METHOD
-
WIN32OLE_PARAM =
WIN32OLE_PARAM
objects represent param information of the OLE method.cWIN32OLE_PARAM
-
WIN32OLE_RECORD =
WIN32OLE_RECORD
objects represents VT_RECORD OLE variant. Win32OLE returnsWIN32OLE_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
cWIN32OLE_RECORD
-
WIN32OLE_TYPE =
WIN32OLE_TYPE
objects represent OLE type library information.cWIN32OLE_TYPE
-
WIN32OLE_TYPELIB =
WIN32OLE_TYPELIB
objects represent OLE tyblib information.cWIN32OLE_TYPELIB
-
WIN32OLE_VARIABLE =
WIN32OLE_VARIABLE
objects represent OLE variable information.cWIN32OLE_VARIABLE
-
WIN32OLE_VARIANT =
WIN32OLE_VARIANT
objects represents OLE variant.Win32OLE converts Ruby object into OLE variant automatically when invoking OLE methods. If OLE method requires the argument which is different from the variant by automatic conversion of Win32OLE, you can convert the specified variant type by using
WIN32OLE_VARIANT
class.param = WIN32OLE_VARIANT.new(10, WIN32OLE::VARIANT::VT_R4) oleobj.method(param)
WIN32OLE_VARIANT
does not support VT_RECORD variant. Use WIN32OLE_RECORD class instead ofWIN32OLE_VARIANT
if the VT_RECORD variant is needed.cWIN32OLE_VARIANT