Vote count: 0
I'm having trouble using the C ++ ReadPrinter function. I'm communicating with a printer and I need to get the status and code return from it. I'm always getting a value of 0.
The code I am using:
DWORD dwBytesRead = 0;
unsigned char buffer2[100];
if (!ReadPrinter(hPrinter, buffer2, 100, &dwBytesRead))
{
std::cout << "Fail to read! " << GetLastError() << std::endl;
return FALSE;
}
else {
std::cout << "Messadge from the bottle xD^ " << buffer2 << std::endl;
}
And I also used the code below and I have the same problem.
if (!GetPrinter(hPrinter, 2, (LPBYTE)pPrnInfo2, dwSize, &dwSize))
{
ClosePrinter(hPrinter);
free(pPrnInfo2);
return FALSE; // Error
}
pPrnInfo2 is NULL.
The printer has bi-directional support.
Tks for support! :)
Att, Damiana
asked 9 secs ago
ReadPrinter Status C++ and ESC/P
Aucun commentaire:
Enregistrer un commentaire