Advanced C Class (ACC) Documentation
Introduction
The Advanced C Class (ACC) is a dynamic and multi-functional C++ class library developed to simplify and accelerate development in Visual C++ environments. Designed as a utility backbone, ACC encapsulates a wide range of Windows-based operations including GUI manipulation, file system handling, process execution, printing services, encryption, media playback, and hardware interaction into a compact, reusable module.
Core Functionality
- High-speed binary file operations (bc, fbc)
- Dialog and control management (edit boxes, combo boxes, buttons)
- Application and service control
- Real-time encryption, hashing, and process status tracking
- Clock, calendar, and system time integration
- Raw-level printer and parallel port communication
- Runtime system status reporting and diagnostics
Modular Architecture
A key feature of ACC is its modular integration with sub-classes, each provided as separate .h, .lib, and .dll files. These sub-classes encapsulate specialized functionality and are controlled directly through ACC. Some notable modules initialized or managed via ACC include:
- CGraph: For generating and managing graphical data output (CreateGraph())
- ESP (Extra Service Parallel Port): For supporting legacy hardware devices through parallel port at address 0x378 (CreateESP())
- PrinterDC: For precise control over print rendering and device contexts
- Audio Feedback Engine: For system time-to-speech conversion (PlayTime())
The ACC class serves as a central controller, allowing seamless runtime communication between the main application and its modular components, ensuring high cohesion and loose coupling.
Integration Usage
- Include ACC.h in your source file.
- Link against ACC.lib during compilation.
- Ensure ACC.dll is available at runtime.
Constructor & Destructor
ACC() - Default constructor
ACC(HWND _hw) - Initializes ACC with a window handle
~ACC() - Destructor
Key Functions
File Operations
- BulkCopy() - Performs bulk file copy
- bc() - Raw binary file copy
- fbc() - Fast binary copy
- IsFilePresent() - Checks if the given file exists
- SetFileToPath() - Appends filename to a path
- GetFileSize() - Retrieves file size
- CreateDumpFile() - Creates a dump file with a message
System and Execution Utilities
- RunAsApplication() - Launches as application
- RunAsService() - Launches as Windows service
- IsRunning() - Checks if an app window is active
- GetApplication() - Gets pointer to a running window
- ExePro() - Executes a process
- ExeProEx() - Executes a process with arguments
Printer Handling
- StartPrinter() - Initializes printer
- StopPrinter() - Stops printing
- ClosePrinterDC() - Releases printer DC
- SetPrinterDC() - Sets the printer device context
Clock and Timer
- InitClock() - Starts internal clock
- StopClock() - Stops clock
- SetClock() - Updates a static control with current time
- GetTimeString() - Gets current time as string
- GetDateString() - Gets date string
UI Controls
- Show/Hide/Enable/Disable ComboBox
- Show/Hide/Enable/Disable EditBox
- Show/Hide/Enable/Disable Button
- Show/Hide/Enable/Disable Static
Utility and Miscellaneous
- BrowseAllFiles() - File browser dialog
- BrowseAllFolders() - Folder browser dialog
- FindBrowser() - Detects installed browser
- FindAssociatedApplication() - Gets the app associated with a file type
- RegisterInf() - Registers INF file
- CHash() - Computes hash (supports SHA32, SHA64, SHA128, etc.)
- RGBtoColors() - Splits RGB color
- Play() - Plays media file
- PlayTime() - Speaks the system time
- SetCalendar() - Sets calendar info
- TimeDifference() - Calculates time difference
- es() - Encrypts a string
- GetProcessMessage() - Fetches last internal status
Experimental or Special
- CreateGraph() - Initializes a sub-AC class CGraph object
- CreateBluetooth() - Starts Bluetooth interaction
- CreateDynamicHandle() - Dynamically creates system handle
- CreateESP() - Creates an Extra Service Parallel Port through 0x378
- SetGWDC() - Sets global window DC
- LoadAppIconRes() - Loads application icon
- Bring2Front(), Set2Front() - Brings app to front
Usage Examples
ACC ac(hwnd); // Create instance
ac.bc("C:\\file1", "D:\\file2"); // Binary Copy
ac.es("hello", buffer, "1234", 5); // Encrypt
ac.PlayTime(); // Play system time
UINT g = ac.CreateGraph();