Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2006, 10:52
Motki
 
Fecha de Ingreso: septiembre-2003
Mensajes: 341
Antigüedad: 20 años, 7 meses
Puntos: 0
crear DLL para imprimir

hola a to2,
Quiero crear una dll que me permita imprimir sin que me aparezca el cuadro de dialogo del browser.
Para ello he creado un pequeño ejemplo para ver si me funciona o no (sin importame que me salga el cuadro de dialo)
La dll que he registrado es la siguiente:
Código:
 
Option Explicit
Private Printer As Printer
Private ScriptingContext As ScriptingContext
Private Application As Application
Private Request As Request
Private Response As Response
Private Server As Server
Private Session As Session
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set ScriptingContext = PassedScriptingContext
Set Application = ScriptingContext.Application
Set Request = ScriptingContext.Request
Set Response = ScriptingContext.Response
Set Server = ScriptingContext.Server
Set Session = ScriptingContext.Session
Set Printer = ScriptingContext.Printer
End Sub
Public Sub OnEndPage()
Set ScriptingContext = Nothing
Set Application = Nothing
Set Request = Nothing
Set Response = Nothing
Set Server = Nothing
Set Session = Nothing
End Sub
Public Sub Mensaje(Texto As String)
Response.Write "<b><font color='red'>" & Texto & "</font></b>"
Printer.Print "Vamos a imprimir este texto"
Printer.EndDoc
End Sub
Luego llamo al objeto desde mi ASP, de la siguiente maneria:

Código:
 
Set Test = Server.CreateObject("ASPTest.Test")
 Test.Mensaje "Hola, esta es una prueba."
 Set Test = Nothing
me funciona pq me sale el texto que le paso pero sin embargo no me imprime...
que estoy haciendo mal?
__________________
---Nuestra recompensa se encuentra en el esfuerzo y no en el resultado. Un esfuerzo total es una victoria completa.-- GHANDI