Fax Software

Community Forums

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2528
    sistemi
    Member

    I’ve a windows 2000 PC’s SP4 and winfax PRO 10.0.
    I’ve developed a faxserver application, which start every X minutes every day. This works fine, except that every 2-3 days, the application hangs on the window (“Converting fax into image”…). So, the next time my application starts, the winfax object is still locked, the word object can’t create a new fax, and all application crash. This is my code for sending:

    ‘**********************************
    Private Function SpedisciFax(rs As Recordset, PrenStr As String) As Boolean

    Dim t As Integer
    Dim OBJwinFAX As Object
    Dim hregkey As Long ‘ receives handle to the newly created or opened registry key
    Dim secattr As SECURITY_ATTRIBUTES ‘ security settings of the key
    Dim subkey As String ‘ name of the subkey to create
    Dim neworused As Long ‘ receives 1 if new key was created or 2 if an existing key was opened
    Dim Ntel As String ‘ the string to put into the registry
    Dim ID As Long ‘ the string to put into the registry
    Dim retval As Long ‘ return value

    On Error GoTo ErrExit

    ‘ Writing registry
    secattr.nLength = Len(secattr) ‘ size of the structure
    secattr.lpSecurityDescriptor = 0 ‘ default security level
    secattr.bInheritHandle = True ‘ the default value for this setting
    Ntel = Trim(ConvNull(rs!NUMERO_FAX))

    ID = Trim(rs!ID)
    Debug.Print ID

    namefile = “c:temp” & Trim(rs!ID) & “_” & Trim(rs!NUMERO_SINISTRO) & “.doc”

    WDoc.SaveAs FileName:=namefile, FileFormat:=wdFormatDocument, LockComments:=False, Password:=””, AddToRecentFiles:=True, WritePassword:=””, ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False

    ‘inserted by WinFaxPro
    Set OBJwinFAX = CreateObject(“WINFAX.SDKSEND8.0”)

    OBJwinFAX.SetNumber (Ntel)
    OBJwinFAX.setsubject (ID)
    OBJwinFAX.SetCompany (“Casa di cura”)
    OBJwinFAX.AddRecipient
    OBJwinFAX.AddAttachmentFile namefile
    OBJwinFAX.Send (0)

    ‘inserito dal WinFaxPro

    WDoc.Close wdDoNotSaveChanges
    WApp.Quit wdDoNotSaveChanges

    Set OBJwinFAX = Nothing

    Set WDoc = Nothing
    Set WApp = Nothing
    SpedisciFax = False
    Exit Function

    ErrExit:
    Call ScriviLog(“Errore nell’invio a WinFax: ” + Str$(Err))
    SpedisciFax = True

    End Function
    ‘**********************************
    I’ve searched in the forum for topics like this, and I hadn’t found nothing exaustive about (i.e.: I release the objwinfax after used; I don’t use in this PC Outlook, cause I know that this could generate problems…)
    Thank in advance for any help/suggestions
    Bye

    #4249
    Anonymous
    Member

    Try using Send(1) instead and wait until the attachment has been created in WinFax before you set the object=nothing.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.