This Window Has Already Been Registered As a Drop Target
Hi all,
Using this code:
Code:
Private Sub IPrinter_Prnt(uPrintJob As PRINT_JOB)
On Error GoTo ERR_Prnt
Const ERROR_LOCATION As String = "Resource.CPrinter.IPrinter_Prnt"
Dim uPrinter As PRINTER
Dim lFreeFile As Long
Dim PCL As String
Dim sBuff As String, sChar As String, lCnt As Long, lLen As Long
Dim Stream() As Byte
'*********************
'* Get the PCL . . .
'*********************
lFreeFile = FreeFile
Open uPrintJob.PCLPath For Binary Access Read Lock Read As #lFreeFile
lLen = LOF(lFreeFile)
ReDim Stream(lLen)
For lCnt = 0 To lLen
Get #lFreeFile, , Stream(lCnt)
Next lCnt
Close #lFreeFile
sBuff = Stream
Stream = StrConv(sBuff, vbFromUnicode)
'****************************
'* Print the document . . .
'****************************
PrintFromStream PhysicalPrintQueue(uPrintJob.LogicalPrinter), Stream
'************************************************************************
'* If we got this far we can't have had an error so remove document . . .
'************************************************************************
Kill uPrintJob.PCLPath
Exit Sub
ERR_Prnt:
App.LogEvent "The following error has occured in " & MODULE_NAME & "IPrinter_Prnt]:" & vbCr & _
"Number: " & Err.Number & vbCr & _
"Source: " & Err.source & vbCr & _
"Description: " & Err.Description, vbLogEventTypeError
Err.Raise Err.Number, Err.source, Err.Description, Err.HelpFile, Err.HelpContext
End Sub
... raises the above error "This window has already been registered as a drop target"
I've googled, and don't even understand what the error message is!
Any thoughts?