Engine.start() To Slow S’abonner

0
Avatar
Legacy Poster

Hi,I use Bartender 10.0 SR2 Enterprise Automation edition + Microsoft Visual Studio 2008
when execute LabelPrint_HT.exe
(LabelPrint_HT.exe C:\Temp\PPZ1045.btw C:\Temp\PPZ1045.txt SATOA CL412e)
waiting Engine.Start() over 90 seconds
--------
Public Sub Main(ByVal strArg() As String)
Dim docFormat As LabelFormatDocument = Nothing
Dim btEngine As Engine = Nothing
Dim intResult As Result

Dim strFilePath_BTW As String
Dim strFilePath_TXT As String
Dim strPrinterVendor As String
Dim strPrinterType As String

Try
WriteLine("btEngine1 NowTime:" & Now.ToLongTimeString)
btEngine = New Engine(True)
WriteLine("btEngine2 NowTime:" & Now.ToLongTimeString)

If strArg.Length > 3 Then
strFilePath_BTW = strArg(0)
strFilePath_TXT = strArg(1)
strPrinterVendor = strArg(2)
strPrinterType = strArg(3)

docFormat = btEngine.Documents.Open(strFilePath_BTW, strPrinterVendor & " " & strPrinterType)
CType(docFormat.DatabaseConnections("TextFileDB"), TextFile).FileName = strFilePath_TXT

WriteLine("docFormat.Print1 NowTime:" & Now.ToLongTimeString)
intResult = docFormat.Print()
WriteLine("docFormat.Print2 NowTime:" & Now.ToLongTimeString)

Select Case intResult
Case Result.Success
WriteLine("Print Success.")
'Case Result.Timeout
' WriteLine("Print Timeout!")
'Case Result.Failure
' WriteLine("Print Failure!")
Case Else
WriteLine("Print Failure!")
WriteLine("------------------------------")
WriteLine("BtwFileName=" & docFormat.FileName)
WriteLine("TxtFileName=" & CType(docFormat.DatabaseConnections("TextFileDB"), TextFile).FileName)
WriteLine("PrinterName=" & docFormat.PrintSetup.PrinterName)
End Select
Else
WriteLine("LabelPrint_HT.exe C:\PZZ0001.btw C:\PZZ0001.txt SATO CL412e")
End If
Catch ex_file As FileNotFoundException
WriteLine("FileNotFoundException Message:" & ex_file.Message)
WriteLine("FileNotFoundException StackTrace:" & ex_file.StackTrace)
Catch ex As Exception
WriteLine("Exception Message:" & ex.Message)
WriteLine("Exception StackTrace:" & ex.StackTrace)
'Throw ex
Finally
If Not docFormat Is Nothing Then
docFormat.Close(SaveOptions.DoNotSaveChanges)
End If
If Not btEngine Is Nothing Then
btEngine.Stop(SaveOptions.DoNotSaveChanges)
End If
End Try
End Sub

Vous devez vous connecter pour laisser un commentaire.