Skip to content

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

  1. Global Static Instantiation: Automatically instantiated when DLL loads, no manual New required, follows the entire application lifecycle
  2. Space for Speed: High-frequency use objects stay resident in memory, avoiding performance overhead from frequent creation and destruction
  3. Global Sharing: Configuration, HTTP clients, and other objects are obtained once and used unlimited times, with data shared globally
  4. Zero Memory Overhead: All objects stay resident in memory but are lazily loaded, only instantiated on first call
  5. Easy to Use: Learned from mature object system designs, with simple and intuitive APIs, ready to use out of the box
  6. Chain Calls: Most objects support chain calls for cleaner code
  7. Type Safety: Complete strong type support with IDE auto-completion
  8. 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

ObjectClassDescription
JsoncJsonJSON parsing and building
CsvcCsvCSV file read/write
InicIniINI configuration file operations
DbcDataBaseDatabase operations (includes Chained CRUD series)
CollectioncCollectionEnhanced collection class

Network Communication

ObjectClassDescription
HttpClientcHttpClientHTTP client requests

File and System

ObjectClassDescription
FileExcFileExAdvanced file operations
ToolsFsocToolsFsoFile system operations
ToolsStreamcToolsStreamFile stream operations
RegeditcRegeditRegistry operations
StartUpcStartUpStartup management

Utilities

ObjectClassDescription
ToolsStrcToolsStrString processing tools
ToolsMathcToolsMathMath operation tools
ToolsHttpcToolsHttpHTTP utility functions
ToolsBase64cToolsBase64Base64 encoding/decoding
ToolsUtf8cToolsUtf8UTF-8 encoding/decoding
ToolsArraycToolsArrayArray operation tools
ToolsDiccToolsDicDictionary operation tools
ToolsListcToolsListList operation tools
ToolsSystemcToolsSystemSystem information tools
ToolsCrccToolsCrcCRC checksum calculation
ToolsWindowcToolsWindowWindow operation tools

UI and Interaction

ObjectClassDescription
DialogcDialogDialog operations
ToastcToastNotification messages

Image Processing

ObjectClassDescription
ImagecImageImage data conversion (chained calls)

Other Features

ObjectClassDescription
LogscLogsLogging
CmdcCmdCommand line execution
TimeUsecTimeUseTiming utilities
PLIcPLIPlugin interface
QRcodecQRcodeQR code generation
PasswordcPasswordPassword processing
DelaycDelayDelayed execution
FormatercFormaterFormatting utilities
BaiducBaiduBaidu 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 ServerUrl

Reference Instructions

To use VBMAN in VB6 projects:

  1. Reference vbman.dll (Project → References)
  2. Ensure DLL is in the same directory as EXE, or properly configure the path
  3. No additional declarations needed, access directly through VBMAN object

VB6 and LOGO copyright of Microsoft Corporation