method
new
Ruby latest stable (v2_5_5)
-
0 notes -
Class: WIN32OLE_RECORD
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
new(p1, p2)
public
Returns WIN32OLE_RECORD object. The first argument is struct name (String or Symbol). The second parameter obj should be WIN32OLE object or WIN32OLE_TYPELIB object. 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 End Class
then, you can create WIN32OLE_RECORD object is as following:
require 'win32ole' obj = WIN32OLE.new('ComServer.ComClass') book1 = WIN32OLE_RECORD.new('Book', obj) # => WIN32OLE_RECORD object tlib = obj.ole_typelib book2 = WIN32OLE_RECORD.new('Book', tlib) # => WIN32OLE_RECORD object