VBMAN.PLI - Plugin Interface Object
Overview
VBMAN.PLI provides functionality for communicating with external plugin programs, implementing extended functionality by executing external programs and passing parameters.
Core Features
- Plugin Execution: Call external plugin programs
- Parameter Passing: Support Base64 encoded parameter passing
- Timeout Control: Configurable execution timeout
- Result Retrieval: Support getting return results from file
Properties
| Property | Type | Description |
|---|---|---|
TimeOut | Long | Execution timeout (milliseconds, default 30 seconds) |
Methods
Request
Send request to plugin
vb
Public Function Request(ParamArray Data() As Variant) As StringParameters:
Data- Variable parameter array, parameters are automatically Base64 encoded
Returns: Result string returned by plugin
Description:
- Plugin program will be searched in order:
App.Path\VBMAN.PLI,App.Path\bin\VBMAN.PLI,App.Path\..\bin\VBMAN.PLI - Parameters are passed separated by
|after Base64 encoding - If return value is
VBMAN.DAT, actual result is read fromVBMAN.DATfile
Example:
vb
' Send simple request
Dim result As String
result = VBMAN.PLI.Request("command", "param1", "param2")
' Process result
If result <> "" Then
Debug.Print "Plugin returned: " & result
End IfComprehensive Examples
Example 1: Basic Usage
vb
Private Sub CallPlugin()
' Set timeout (optional, default 30 seconds)
VBMAN.PLI.TimeOut = 60000 ' 60 seconds
' Call plugin
Dim result As String
result = VBMAN.PLI.Request("process", "data1", "data2")
If result <> "" Then
MsgBox "Processing result: " & result
Else
MsgBox "Call failed or no return"
End If
End SubExample 2: Process File Result
vb
Private Sub CallPluginWithFileResult()
Dim result As String
result = VBMAN.PLI.Request("generate_report", "2024-01-01", "2024-12-31")
' If plugin returns VBMAN.DAT, result is in file
If result = "VBMAN.DAT" Then
Dim fileContent As String
fileContent = VBMAN.ToolsStream.LoadFileAsText(App.Path & "\VBMAN.DAT")
Debug.Print fileContent
End If
End SubPlugin Specification
Plugin programs need to follow these specifications:
- Executable file named
VBMAN.PLI - Receive Base64 encoded parameters (separated by
|) - Support
VBMAN.PSCas script file parameter - Can return results via output or
VBMAN.DATfile
Notes
- Plugin program must exist in specified search path
- Parameters are automatically Base64 encoded
- Process will be forcibly terminated after timeout