FrymasterVB/DWPRINFO.CLS.md

1.8 KiB

DWPRINFO.CLS Documentation

Overview

The dwPrinterInfo class provides functionality for handling Windows printer information structures. It allows access to various printer information levels (1, 2, 4, and 5) through a unified interface.

Class Properties

  • Level& - Stores the printer information level (1, 2, 4, or 5)
  • Various printer information fields including:
    • Flags&
    • pDescription$
    • pName$
    • pComment$
    • pServerName$
    • pPrinterName$
    • pShareName$
    • pPortName$
    • pDriverName$
    • pLocation$
    • Attributes&
    • Priority&
    • Status&
    • cJobs&
    • And more...

Methods

ResetContents()

Resets all class properties to their default values.

LoadInfo(Buf As Byte, pLevel&, x&)

Main method to load printer information from a byte buffer.

  • Parameters:
    • Buf: Byte buffer containing printer information
    • pLevel: Information level (1, 2, 4, or 5)
    • x: Index offset for multiple printer structures

LoadPrinterInfo1(Buf As Byte, x&)

Loads Level 1 printer information (basic printer properties).

  • Contains: Flags, Description, Name, Comment

LoadPrinterInfo2(Buf As Byte, x&)

Loads Level 2 printer information (detailed printer properties).

  • Contains: Complete printer configuration including server name, share name, location, status, etc.

LoadPrinterInfo4(Buf As Byte, x&)

Loads Level 4 printer information (minimal printer properties).

  • Contains: Printer name, server name, attributes

LoadPrinterInfo5(Buf As Byte, x&)

Loads Level 5 printer information (printer timing properties).

  • Contains: Printer name, port name, attributes, timeout values

Usage Notes

  • The class uses Windows API structures (PRINTER_INFO_x) to manage printer data
  • Implements proper memory handling for string pointers
  • Supports multiple printer information levels for different use cases
  • Part of the Desaware API Class library