Ver Mensaje Individual
  #3  
Antiguo 16-06-2017
Avatar de hgiacobone
hgiacobone hgiacobone is offline
Miembro
 
Registrado: may 2003
Ubicación: La Plata, Bs. As., Argentina
Posts: 165
Reputación: 21
hgiacobone Va por buen camino
Thumbs up Tema Solucionado

Bueno amigos, luego de mucho andar, he aqui la solución.
La instrucción original, debe modificarse de esta forma:

Código Delphi [-]
function Write_RAW_StringToPrinter(PrinterName:String; comando:String): Boolean;
var
   PrinterHandle: THandle;
   N: DWORD;
   DocInfo1: TDocInfo1;
begin
  if not WinSpool.OpenPrinter(PAnsiChar( PrinterName ), PrinterHandle, nil)
   then raise exception.create(PrinterName+#13+'OpenPrinter error ' + IntToStr(GetLastError));

  Try
      with DocInfo1 do
      begin
        pDocName := PWideChar('Mi nombre es Yako');
        pOutputFile := nil;
        pDataType := PWideChar('RAW');
      end;
      if StartDocPrinter(PrinterHandle, 1, @DocInfo1) <> 0  then
      begin
          StartPagePrinter(PrinterHandle) ;
          WritePrinter(PrinterHandle , PAnsiChar( RawByteString(comando) ) , Length(comando) , N);
     end;

...y asi recibe la cantidad de Bytes correctos.
__________________
Gracias de antemano por vuestra ayuda.
·.:*:.·Yako·.:*:.·
Responder Con Cita