Class: CP2Connection

Inherits:
Base
  • Object
show all
Includes:
WIN32OLE::VARIANT
Defined in:
lib/ole20110223-013209.rb

Overview

P2Connection Class

Constant Summary collapse

CLSID =

P2ClientGate_P2Connection_1

'{CCD42082-33E0-49EA-AED3-9FE39978EB56}'
PROGID =
'P2ClientGate.P2Connection.1'

Constants included from WIN32OLE::VARIANT

WIN32OLE::VARIANT::VT_ARRAY, WIN32OLE::VARIANT::VT_BOOL, WIN32OLE::VARIANT::VT_BSTR, WIN32OLE::VARIANT::VT_BYREF, WIN32OLE::VARIANT::VT_CY, WIN32OLE::VARIANT::VT_DATE, WIN32OLE::VARIANT::VT_DISPATCH, WIN32OLE::VARIANT::VT_EMPTY, WIN32OLE::VARIANT::VT_ERROR, WIN32OLE::VARIANT::VT_I1, WIN32OLE::VARIANT::VT_I2, WIN32OLE::VARIANT::VT_I4, WIN32OLE::VARIANT::VT_I8, WIN32OLE::VARIANT::VT_INT, WIN32OLE::VARIANT::VT_NULL, WIN32OLE::VARIANT::VT_PTR, WIN32OLE::VARIANT::VT_R4, WIN32OLE::VARIANT::VT_R8, WIN32OLE::VARIANT::VT_UI1, WIN32OLE::VARIANT::VT_UI2, WIN32OLE::VARIANT::VT_UI4, WIN32OLE::VARIANT::VT_UI8, WIN32OLE::VARIANT::VT_UINT, WIN32OLE::VARIANT::VT_UNKNOWN, WIN32OLE::VARIANT::VT_USERDEFINED, WIN32OLE::VARIANT::VT_VARIANT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ CP2Connection

Returns a new instance of CP2Connection.



12
13
14
# File 'lib/ole20110223-013209.rb', line 12

def initialize opts = {}
  super PROGID, opts
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(cmd, *args) ⇒ Object



16
17
18
# File 'lib/ole20110223-013209.rb', line 16

def method_missing(cmd, *args)
  @ole.method_missing(cmd, *args)
end

Instance Attribute Details

#lastargsObject (readonly)

Returns the value of attribute lastargs.



9
10
11
# File 'lib/ole20110223-013209.rb', line 9

def lastargs
  @lastargs
end

#oleObject (readonly)

Returns the value of attribute ole.



10
11
12
# File 'lib/ole20110223-013209.rb', line 10

def ole
  @ole
end

Instance Method Details

#AppNameObject

property BSTR AppName



39
40
41
# File 'lib/ole20110223-013209.rb', line 39

def AppName()
  @ole._getproperty(2, [], [])
end

#AppName=(val) ⇒ Object

property VOID AppName



69
70
71
# File 'lib/ole20110223-013209.rb', line 69

def AppName=(val)
  @ole._setproperty(2, [val], [VT_BSTR])
end

#clsidObject



25
26
27
# File 'lib/ole20110223-013209.rb', line 25

def clsid
  CLSID
end

#ConnectObject

method UI4 Connect



99
100
101
# File 'lib/ole20110223-013209.rb', line 99

def Connect()
  @ole._invoke(9, [], [])
end

#Connect2(conn_str) ⇒ Object

method UI4 Connect2

BSTR conn_str [IN]


151
152
153
# File 'lib/ole20110223-013209.rb', line 151

def Connect2(conn_str)
  @ole._invoke(18, [conn_str], [VT_BSTR])
end

#ConnectionStatusChanged(conn, new_status) ⇒ Object

method VOID ConnectionStatusChanged - EVENT in IP2ConnectionEvent

IP2Connection conn [IN]
TConnectionStatus new_status [IN]


176
177
178
# File 'lib/ole20110223-013209.rb', line 176

def ConnectionStatusChanged(conn, new_status)
  @ole._invoke(1, [conn, new_status], [VT_BYREF|VT_DISPATCH, VT_DISPATCH])
end

#DisconnectObject

method VOID Disconnect



104
105
106
# File 'lib/ole20110223-013209.rb', line 104

def Disconnect()
  @ole._invoke(10, [], [])
end

#GetConn(p_val) ⇒ Object

HRESULT GetConn

OLE_HANDLE p_val [OUT]


163
164
165
# File 'lib/ole20110223-013209.rb', line 163

def GetConn(p_val)
  keep_lastargs @ole._invoke(1610678272, [p_val], [VT_BYREF|VT_BYREF|VT_DISPATCH])
end

#GetConnPtr(p_val) ⇒ Object

HRESULT GetConnPtr

OLE_HANDLE p_val [OUT]


169
170
171
# File 'lib/ole20110223-013209.rb', line 169

def GetConnPtr(p_val)
  keep_lastargs @ole._invoke(1610678273, [p_val], [VT_BYREF|VT_BYREF|VT_DISPATCH])
end

#HostObject

property BSTR Host



49
50
51
# File 'lib/ole20110223-013209.rb', line 49

def Host()
  @ole._getproperty(4, [], [])
end

#Host=(val) ⇒ Object

property VOID Host



74
75
76
# File 'lib/ole20110223-013209.rb', line 74

def Host=(val)
  @ole._setproperty(4, [val], [VT_BSTR])
end

#keep_lastargs(return_value) ⇒ Object



20
21
22
23
# File 'lib/ole20110223-013209.rb', line 20

def keep_lastargs(return_value)
  @lastargs = WIN32OLE::ARGV
  return_value
end

#LoginObject

method VOID Login



109
110
111
# File 'lib/ole20110223-013209.rb', line 109

def Login()
  @ole._invoke(11, [], [])
end

#LoginStrObject

property BSTR LoginStr



64
65
66
# File 'lib/ole20110223-013209.rb', line 64

def LoginStr()
  @ole._getproperty(8, [], [])
end

#LoginStr=(val) ⇒ Object

property VOID LoginStr



94
95
96
# File 'lib/ole20110223-013209.rb', line 94

def LoginStr=(val)
  @ole._setproperty(8, [val], [VT_BSTR])
end

#LogoutObject

method VOID Logout



114
115
116
# File 'lib/ole20110223-013209.rb', line 114

def Logout()
  @ole._invoke(12, [], [])
end

#NodeNameObject

property BSTR NodeName



44
45
46
# File 'lib/ole20110223-013209.rb', line 44

def NodeName()
  @ole._getproperty(3, [], [])
end

#Password=(val) ⇒ Object

property VOID Password



84
85
86
# File 'lib/ole20110223-013209.rb', line 84

def Password=(val)
  @ole._setproperty(6, [val], [VT_VARIANT])
end

#PortObject

property UI4 Port



54
55
56
# File 'lib/ole20110223-013209.rb', line 54

def Port()
  @ole._getproperty(5, [], [])
end

#Port=(val) ⇒ Object

property VOID Port



79
80
81
# File 'lib/ole20110223-013209.rb', line 79

def Port=(val)
  @ole._setproperty(5, [val], [VT_UI4])
end

#ProcessMessage(cookie, poll_timeout) ⇒ Object

method VOID ProcessMessage

UI4 cookie [OUT]
UI4 poll_timeout [IN]


121
122
123
# File 'lib/ole20110223-013209.rb', line 121

def ProcessMessage(cookie, poll_timeout)
  keep_lastargs @ole._invoke(13, [cookie, poll_timeout], [VT_BYREF|VT_UI4, VT_UI4])
end

#ProcessMessage2(poll_timeout) ⇒ Object

method UI4 ProcessMessage2

UI4 poll_timeout [IN]


145
146
147
# File 'lib/ole20110223-013209.rb', line 145

def ProcessMessage2(poll_timeout)
  @ole._invoke(17, [poll_timeout], [VT_UI4])
end

#ProcessMessage3(poll_timeout) ⇒ Object

method UI4 ProcessMessage3

UI4 poll_timeout [IN]


157
158
159
# File 'lib/ole20110223-013209.rb', line 157

def ProcessMessage3(poll_timeout)
  @ole._invoke(19, [poll_timeout], [VT_UI4])
end

#progidObject



29
30
31
# File 'lib/ole20110223-013209.rb', line 29

def progid
  PROGID
end

#RegisterReceiver(new_receiver) ⇒ Object

method UI4 RegisterReceiver

IP2MessageReceiver new_receiver [IN]


127
128
129
# File 'lib/ole20110223-013209.rb', line 127

def RegisterReceiver(new_receiver)
  @ole._invoke(14, [new_receiver], [VT_BYREF|VT_DISPATCH])
end

#ResolveService(service) ⇒ Object

method BSTR ResolveService

BSTR service [IN]


139
140
141
# File 'lib/ole20110223-013209.rb', line 139

def ResolveService(service)
  @ole._invoke(16, [service], [VT_BSTR])
end

#StatusObject

property I4 Status



34
35
36
# File 'lib/ole20110223-013209.rb', line 34

def Status()
  @ole._getproperty(1, [], [])
end

#TimeoutObject

property UI4 Timeout



59
60
61
# File 'lib/ole20110223-013209.rb', line 59

def Timeout()
  @ole._getproperty(7, [], [])
end

#Timeout=(val) ⇒ Object

property VOID Timeout



89
90
91
# File 'lib/ole20110223-013209.rb', line 89

def Timeout=(val)
  @ole._setproperty(7, [val], [VT_UI4])
end

#UnRegisterReceiver(cookie) ⇒ Object

method VOID UnRegisterReceiver

UI4 cookie [IN]


133
134
135
# File 'lib/ole20110223-013209.rb', line 133

def UnRegisterReceiver(cookie)
  @ole._invoke(15, [cookie], [VT_UI4])
end