123456789_123456789_123456789_123456789_123456789_

Class: Object

Constant Summary

  • WIN32OLE_EVENT =

    WIN32OLE_EVENT objects controls OLE event.

    # File 'ext/win32ole/win32ole_event.c', line 1268
    cWIN32OLE_EVENT
  • WIN32OLE_METHOD =

    WIN32OLE_METHOD objects represent OLE method information.

    # File 'ext/win32ole/win32ole_method.c', line 931
    cWIN32OLE_METHOD
  • WIN32OLE_PARAM =

    WIN32OLE_PARAM objects represent param information of the OLE method.

    # File 'ext/win32ole/win32ole_param.c', line 426
    cWIN32OLE_PARAM
  • WIN32OLE_RECORD =

    WIN32OLE_RECORD 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
    # File 'ext/win32ole/win32ole_record.c', line 598
    cWIN32OLE_RECORD
  • WIN32OLE_TYPE =

    WIN32OLE_TYPE objects represent OLE type library information.

    # File 'ext/win32ole/win32ole_type.c', line 891
    cWIN32OLE_TYPE
  • WIN32OLE_TYPELIB =

    WIN32OLE_TYPELIB objects represent OLE tyblib information.

    # File 'ext/win32ole/win32ole_typelib.c', line 831
    cWIN32OLE_TYPELIB
  • WIN32OLE_VARIABLE =

    WIN32OLE_VARIABLE objects represent OLE variable information.

    # File 'ext/win32ole/win32ole_variable.c', line 373
    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 of WIN32OLE_VARIANT if the VT_RECORD variant is needed.

    # File 'ext/win32ole/win32ole_variant.c', line 699
    cWIN32OLE_VARIANT