Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/07/2009, 14:05
Avatar de Middrel
Middrel
 
Fecha de Ingreso: abril-2005
Mensajes: 835
Antigüedad: 19 años, 1 mes
Puntos: 27
Respuesta: Apoyo con un programa en VB6

Sólo para compensar un poco la ayuda que he recibido

Después de pasar un fin de semana de locos buscando la solución a esto, por fin lo logré, les pongo aquí el código final para aquél que desee emplearlo.

Código:
Public Sub MandarAminiPrinter(Texto As String, Optional Preview As Boolean = True)
    Dim tempstr As String
    Dim b() As Byte
    Dim n As Integer

    On Local Error Resume Next
    
    If Preview Then
        Dim f As New frmTicketPreview
        Load f
        f.Texto = Texto
        f.Show vbModal
        Exit Sub
    End If

        b = LoadResData(101, "CUSTOM")
        n = FreeFile
        If Dir(App.Path & "\bat.bat.pif") <> "" Then
            FileCopy App.Path & "\bat.bat.pif", App.Path & "\b.pif"
        Else
            Kill "b.pif"
            If Err Then Err.Clear
            Open App.Path & "\b.pif" For Binary As n
                Put #n, , b
            Close
            If Err Then Err.Clear
        End If
        
        Debug.Print "len del texto a imprimir: "; Len(Texto)
        CrearArchivoTextoImpresion Texto
        Printer.Print Texto
        Printer.EndDoc
        
        Kill "C:\bat.bat"
        
        If Err Then Err.Clear
        Open "C:\bat.bat" For Binary As n
            Put #n, , "copy """ & App.Path & "\temp.tmp"" lpt1:"
        Close
        
        If Err Then
            MsgBox "Hipocaja no pudo escribir un archivo temporal de impresión. Cierre los archivos que esté utilizando, y si el problema persiste, reinicie su computadora. Hipocaja intentará mandar la impresión correctamente.", vbCritical, Titulo_Largo
            Err.Clear
        End If
        
        Shell App.Path & "\b.pif", vbHide
         
End Sub
Para los que no lo hayan notado, solo coloqué la siguiente instrucción:

Código:
Debug.Print "len del texto a imprimir: "; Len(Texto)
        CrearArchivoTextoImpresion Texto
        Printer.Print Texto
        Printer.EndDoc
Con eso, el sistema ya imprime facturas, notas, tickets y reportes para la tienda de autoservicio y no depende de una sola impresora ni de un sólo sistema operativo.

Saludos y gracias a todos los que me apoyaron