|
RoutixRPCServer.dll |
This library contains RoutixRPCServer.Root automation COM-object. ProgID: "RoutixRPCServer.Root".
NOTE: For registered users created custom build with different ProgID and GUID's.
Example of using in VBScript:
'Define events handlers:
Function RPCServer_OnUserCheck(AUserName, APassword)
WScript.Echo "RPCServer_OnUserCheck: " & AUserName & ", " & APassword
If (AUserName = "Administrator") And (APassword = "password") Then
RPCServer_OnUserCheck = True
Else
RPCServer_OnUserCheck = False
End If
End Function
Function RPCServer_OnQueryObject(AProgID)
WScript.Echo "RPCServer_OnQueryObject: " & AProgID
If (AProgID = "WScript.Shell") Then
'If return NULL - RPC server try to create this object
'via CoCreateInstance windows API
RPCServer_OnQueryObject = Null
ElseIf (AProgID = "MyCustomObject") Then
'or you can return your custom object
Set RPCServer_OnQueryObject = WScript.CreateObject("MyObject.Name")
Else
RPCServer_OnQueryObject = "You can not to create object " & AProgID
End If
End Function
'Greate RPC server and connect events
Set RPCServer = WScript.CreateObject("RoutixRPCServer.Root", "RPCServer_")
'Init object
RPCServer.ListenPort = 56565
RPCServer.ListenHost = "127.0.0.1"
'Start listen
RPCServer.StartListen
Do While True
WScript.Sleep 1000
Loop
' Restrictions of the DEMO version:
' 1. Login ignored;
' 2. Listen port and host can not be changed;
' 3. Max connections at the same time to server equals to 2;
' 4. OnQueryObject ignored: objects created via windows API.