Patch level : 12.0 1072

Files correlati     : xvaga.dll

Commento        :

Aggiunte segnalazioni in caso di errore nell'apertura della stampante a basso livello
This commit is contained in:
smen 2021-08-31 16:00:06 +02:00
parent 463374db35
commit a57bae3cb2

View File

@ -195,12 +195,27 @@ void* OsWin32_GetPrinterInfo(int& size, const char* printer)
pdm = (LPDEVMODE)new BYTE[size]; // Alloca un DEVMODE sufficientemente capiente
memset(pdm, 0, size); // Azzera tutto per bene
::DocumentProperties(0, hPrinter, name, pdm, NULL, DM_OUT_BUFFER); // Legge DEVMODE
size = AdjustDevmodePlease(pdm);
size = AdjustDevmodePlease(pdm);
if (size <= 0)
{
wxString msg = "DocumentProperties fallita fase 2 - stampante "; msg << name;
MessageBox(NULL, msg, "ERRORE", MB_ABORTRETRYIGNORE);
}
}
else
{
wxString msg = "DocumentProperties fallita fase 1 - stampante "; msg << name;
MessageBox(NULL, msg, "ERRORE", MB_ABORTRETRYIGNORE);
size = 0;
}
::ClosePrinter(hPrinter);
}
else
{
wxString msg = "OpenPrinte fallita - stampante "; msg << name;
MessageBox(NULL, msg, "ERRORE", MB_ABORTRETRYIGNORE);
}
return pdm;
}