lock not working on w2k

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
btt423
Posts: 1
Joined: Tue Jan 11 2005

lock not working on w2k

Post by btt423 »

I am attempting to use the lock function and I'm getting a result of -1. What does this error result mean? The app I created works great on another server (that is w2k as well) I have, so I can not figure out what the problem is. Here is the code:

Code: Select all

    Dim cdi As New CDIntfEx.CDIntfEx
    Dim strLockName As String
    Dim lngAPIResult As Integer
    Dim lngLockResult As Long
    
    ' attach to existing printer
    m_strPDFFileName = App.Path & "\pdf\" & m_lngID & ".pdf"
    strLockName = m_strPDFFileName
    With cdi
        .DriverInit (strChosenPrinter)
        .Resolution = 600
        lngLockResult = .Lock(strLockName)
        If lngLockResult <> 0 Then
            WriteToLog ("ERROR: The PDF printer was not locked.  Lockname provided was '" & strLockName & "' and the lock result was " & CStr(lngLockResult))
        Else
            .SetDocFileProps strLockName, NoPrompt + UseFileName, "", m_strPDFFileName
            m_blnPrinterInitialized = True
        End If
    End With
Any ideas?
Post Reply