cPLI External Program Interface Component
Introduction
cPLI (Programmable Language Interface) is an external program call interface component used to call external executables (such as Python, Node.js scripts) from VB6 applications and exchange data through standard input/output.
How It Works
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ VB6 App │ ──▶ │ cPLI Component │ ──▶ │ External (PLI) │
│ │ │ │ │ │
│ PLI.Request() │ │ Base64 encode │ │ VBMAN.PLI │
│ │ │ Execute cmd │ │ (Python/Exe) │
│ Get result │ ◀── │ Return result │ ◀── │ Process data │
└─────────────────┘ └─────────────────┘ └─────────────────┘File Description
| File | Description |
|---|---|
VBMAN.PLI | External executable (main program) |
VBMAN.PSC | Script/config file |
VBMAN.DAT | Data exchange file (for large return values) |
Features
- Parameter Passing: Uses Base64 + UTF-8 encoding to pass parameters
- Timeout Control: Can set command execution timeout
- Large Return Values: Supports returning large data via file
- Auto Search: Auto searches multiple paths for PLI program
Quick Start
Basic Call
vb
Dim PLI As New cPLI
Dim result As String
' Call external program
result = PLI.Request("param1", "param2", "param3")
Debug.Print "Return result: " & resultSet Timeout
vb
Dim PLI As New cPLI
' Set 60 second timeout (default 30 seconds)
PLI.TimeOut = 60 * 1000
Dim result As String
result = PLI.Request("data")Process JSON Data
vb
Dim PLI As New cPLI
' Send JSON data
Dim json As String
json = "{\"name\":\"John\",\"age\":25}"
Dim result As String
result = PLI.Request(json)
' Parse returned JSON
Dim response As New cJson
response.Decode result
Debug.Print response.GetItem("status")File Path Search Order
Component searches for VBMAN.PLI in the following order:
App.Path\VBMAN.PLIApp.Path\bin\VBMAN.PLIApp.Path\..\bin\VBMAN.PLI
If not found, throws 404 error.
Typical Use Cases
| Scenario | Description |
|---|---|
| Python Scripts | Call Python for data processing, AI inference |
| Node.js Programs | Call JavaScript tools |
| Command Line Tools | Call system command line programs |
| Data Processing | Complex calculations, format conversion, etc. |
Last Updated: 2026-05-17