DECLARE INTEGER GetPrinterDriver IN winspool.drv ; INTEGER, ; STRING, ; INTEGER, ; STRING, ; INTEGER, ; INTEGER>It would be helpfull if you post your DECLARE for GetPrinterDriver.
>>>* Get the size of the buffer required >>>IF GetPrinterDriver(PrHandel, "", 1, "", 0, @RecvdBufferLen) = 0 >>> IF GetLastError() <> 122 && The buffer too small error >>> * Do something >>> RETURN .F. >>> ENDIF >>>ENDIF >>>See Enumerating printer forms under Windows NT/2K/XP FAQ #22445 for how to handle API errors.
>>>>PrHandel = 0 >>>>?OpenPrinter("\\print01\Plan1", @PrHandel, 0) >>>>?PrHandel >>>> >>>>RecvdBufferLen = 0 >>>> >>>>?GetPrinterDriver(PrHandel, "", 1, "", 0, @RecvdBufferLen) >>>> >>>>Test = space(RecvdBufferLen) >>>>*EnvString = "Windows XP" >>>>EnvString = "" >>>> >>>>?GetPrinterDriver(PrHandel, EnvString, 1, @Test, RecvdBufferLen, @RecvdBufferLen)