Skip to content

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

PropertyTypeDescription
TimeOutLongExecution timeout (milliseconds, default 30 seconds)

Methods

Request

Send request to plugin

vb
Public Function Request(ParamArray Data() As Variant) As String

Parameters:

  • 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 from VBMAN.DAT file

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 If

Comprehensive 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 Sub

Example 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 Sub

Plugin Specification

Plugin programs need to follow these specifications:

  1. Executable file named VBMAN.PLI
  2. Receive Base64 encoded parameters (separated by |)
  3. Support VBMAN.PSC as script file parameter
  4. Can return results via output or VBMAN.DAT file

Notes

  • Plugin program must exist in specified search path
  • Parameters are automatically Base64 encoded
  • Process will be forcibly terminated after timeout

VB6 and LOGO copyright of Microsoft Corporation