VBMAN Global Static Object Documentation
Overview
VBMAN is a global static object instance in VB6 projects. After referencing vbman.dll, it can be used anywhere in the VB6 project without manual New instantiation.
Core Advantages
- Global Static Instantiation: Automatically instantiated when DLL loads, no manual
Newrequired, follows the entire application lifecycle - Space for Speed: High-frequency use objects stay resident in memory, avoiding performance overhead from frequent creation and destruction
- Global Sharing: Configuration, HTTP clients, and other objects are obtained once and used unlimited times, with data shared globally
- Zero Memory Overhead: All objects stay resident in memory but are lazily loaded, only instantiated on first call
- Easy to Use: Learned from mature object system designs, with simple and intuitive APIs, ready to use out of the box
- Chain Calls: Most objects support chain calls for cleaner code
- Type Safety: Complete strong type support with IDE auto-completion
- Production Verified: Widely used in multiple real-world projects
Quick Start
vb
' Use directly after referencing vbman.dll
Dim Result As String
Result = VBMAN.Json.Encode(SomeObject)
' Database operation example
VBMAN.Db.Sql("SELECT * FROM users WHERE id=?").Param("id", 1).Fetch
' File operation example
VBMAN.ToolsFso.AutoMakeDir "C:\MyApp\Data"Sub-object List
Data Operations
| Object | Class | Description |
|---|---|---|
| Json | cJson | JSON parsing and building |
| Csv | cCsv | CSV file read/write |
| Ini | cIni | INI configuration file operations |
| Db | cDataBase | Database operations (includes Chained CRUD series) |
| Collection | cCollection | Enhanced collection class |
Network Communication
| Object | Class | Description |
|---|---|---|
| HttpClient | cHttpClient | HTTP client requests |
File and System
| Object | Class | Description |
|---|---|---|
| FileEx | cFileEx | Advanced file operations |
| ToolsFso | cToolsFso | File system operations |
| ToolsStream | cToolsStream | File stream operations |
| Regedit | cRegedit | Registry operations |
| StartUp | cStartUp | Startup management |
Utilities
| Object | Class | Description |
|---|---|---|
| ToolsStr | cToolsStr | String processing tools |
| ToolsMath | cToolsMath | Math operation tools |
| ToolsHttp | cToolsHttp | HTTP utility functions |
| ToolsBase64 | cToolsBase64 | Base64 encoding/decoding |
| ToolsUtf8 | cToolsUtf8 | UTF-8 encoding/decoding |
| ToolsArray | cToolsArray | Array operation tools |
| ToolsDic | cToolsDic | Dictionary operation tools |
| ToolsList | cToolsList | List operation tools |
| ToolsSystem | cToolsSystem | System information tools |
| ToolsCrc | cToolsCrc | CRC checksum calculation |
| ToolsWindow | cToolsWindow | Window operation tools |
UI and Interaction
| Object | Class | Description |
|---|---|---|
| Dialog | cDialog | Dialog operations |
| Toast | cToast | Notification messages |
Image Processing
| Object | Class | Description |
|---|---|---|
| Image | cImage | Image data conversion (chained calls) |
Other Features
| Object | Class | Description |
|---|---|---|
| Logs | cLogs | Logging |
| Cmd | cCmd | Command line execution |
| TimeUse | cTimeUse | Timing utilities |
| PLI | cPLI | Plugin interface |
| QRcode | cQRcode | QR code generation |
| Password | cPassword | Password processing |
| Delay | cDelay | Delayed execution |
| Formater | cFormater | Formatting utilities |
| Baidu | cBaidu | Baidu service interface |
Usage Patterns
Direct Usage Pattern
vb
' Simplest usage - direct call on global object
Dim jsonText As String
jsonText = VBMAN.Json.Encode(myData)Chain Call Pattern
vb
' Objects supporting chain calls can be called continuously
VBMAN.Db.Sql("SELECT * FROM users").Fetch
Debug.Print VBMAN.Db.Row("name")Independent Instance Pattern
vb
' When multiple independent instances are needed, create with New
Dim json1 As New cJson
Dim json2 As New cJson
json1.Item("key1") = "value1"
json2.Item("key2") = "value2"Global Sharing Pattern
vb
' Load configuration file at program startup
VBMAN.Ini.LoadFrom "C:\MyApp\config.ini"
' Read configuration values anywhere
Dim ServerUrl As String
ServerUrl = VBMAN.Ini("Database")("ServerUrl")
' Modify configuration values (in memory)
VBMAN.Ini("Database")("ServerUrl") = "http://newserver.com"
' Save to file at any time
VBMAN.Ini.Save
' HttpClient and other objects are also globally shared, configure once, use unlimited times
VBMAN.HttpClient.SetBaseUrl ServerUrlReference Instructions
To use VBMAN in VB6 projects:
- Reference
vbman.dll(Project → References) - Ensure DLL is in the same directory as EXE, or properly configure the path
- No additional declarations needed, access directly through
VBMANobject