dart-windows / win32

Build Win32 apps with Dart!
https://win32.pub
BSD 3-Clause "New" or "Revised" License
735 stars 118 forks source link

ReadPrinter does not work any suggestion or example code please share #817

Closed sonal-maniya closed 4 months ago

sonal-maniya commented 4 months ago

    // Read the response from the printer
    const bufferSize = 1024;
    final buffer = calloc<Uint8>(bufferSize);
    final bytesRead = calloc<DWORD>();

    final successRead = ReadPrinter(
      printerHandle.value,
      buffer.cast(),
      bufferSize,
      bytesRead,
    );

    if (successRead == 0) {
      final error = GetLastError();
      throw Exception('Failed to read print status, error: $error');
    }`