Posted by: Marc
I would like to change the printer-settings, what is incorrect?
Set hPrinterDC = CreateDCA( sDriver, sDevice, STRING_Null, STRING_Null )
If OpenPrinterA( sDevice, hPrinter, STRING_Null )
Set nBufferLength = 32
Call SalStrSetBufferLength( sBuffer, nBufferLength )
If not GetPrinterA( hPrinter, 2, sBuffer, nBufferLength, nBufferLength )
Call SalStrSetBufferLength( sBuffer, nBufferLength )
If not GetPrinterA( hPrinter, 2, sBuffer, nBufferLength, nBufferLength)
Call ClosePrinter( hPrinter )
Call SalMessageBox( 'GetPrinterError','Error', MB_Ok | MB_IconStop )
Return FALSE
Set pDevMode = CStructGetFarPointer( sBuffer, 4*7 )
Call SalStrSetBufferLength( sDevMode, 156 )
Call CStructCopyFromFarMem( pDevMode, sDevMode, 156 )
Set nCopiesOffset = 32+2*4+4+5*2
Set nNbCopies = 4
Call CStructPutWord(sDevMode, nCopiesOffset,nNbCopies)
Set nResult = DocumentPropertiesA( hWndNULL, hPrinter, sDevice,sDevMode,
sDevMode, DM_IN_BUFFER or DM_OUT_BUFFER )
Set hPrinterDC = ResetDCA(hPrinterDC,sDevMode)