Fax Software

Community Forums

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2641
    Anonymous
    Member

    Hi to all,

    I create a fax using SDK, everythigns goes ok but I get two faxes, same image, same fax number ready to go.
    Some times I get only one, but very often I get two.

    Do you know why ?

    #4464
    Anonymous
    Member

    @Vincenzo wrote:

    Hi to all,

    I create a fax using SDK, everythigns goes ok but I get two faxes, same image, same fax number ready to go.
    Some times I get only one, but very often I get two.

    Do you know why ?

    I would suggest you post your code that you are using, because if I remember correctly it had to do with a coding error not a problem in the SDK

    #4465
    Anonymous
    Member

    @Moderator wrote:

    I would suggest you post your code that you are using, because if I remember correctly it had to do with a coding error not a problem in the SDK

    Here my code, thanx for your help


    Dim sendObj As Object

    Dim ret As Integer

    Set sendObj = CreateObject("WinFax.SDKSend")

    Call Sleep(2000)

    If sendObj.SetClientID(App.Title) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetClientID")
    End If
    If sendObj.SetNumber( myfaxnumber ) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetNumber")
    End If

    If sendObj.SetTo(namepeopleto) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetTo")
    End If

    'imposto la ditta che deve ricevere
    If sendObj.SetCompany(namefirmto) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetCompany")
    End If


    If Len(Trim(fp.Data)) > 0 Then
     If sendObj.SetDate(fp.Data) = 1 Then
       Call Err.Raise(9999, "SendFax", "Errore in SetDate")
     End If
    End If


    'Time in HH:MM:SS 24-hour format.
    If Len(Trim(fp.Orario)) > 0 Then
     If sendObj.SetTime(fp.Orario) = 1 Then
       Call Err.Raise(9999, "SendFax", "Errore in SetTime")
     End If
    End If


    If sendObj.SetTypeByName("fax") = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetTypeByName")
    End If
           
                   
    If sendObj.AddRecipient() = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in AddRecipient")
    End If
       
     
    'lo si scrive anche se in realtà se gli si bassa 0 non va
    If fp.SendCover And FileExists(fp.FileCopertina) Then
     
     If sendObj.SetQuickCover(0) = 1 Then
       Call Err.Raise(9999, "SendFax", "Errore in SetQuickCover")
     End If
     
     If sendObj.SetUseCover(1) = 1 Then
       Call Err.Raise(9999, "SendFax", "Errore in SetUseCover")
     End If
     
     If sendObj.SetCoverFile(fp.FileCopertina) = 1 Then
       Call Err.Raise(9999, "SendFax", "Errore in SetCoverFile")
     End If
       
    Else
     sendObj.SetQuickCover (0)
     sendObj.SetUseCover (0)
    End If

    If sendObj.SetResolution(0) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetResolution")
    End If

    If sendObj.EnableBillingCodeKeyWords(0) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in EnableBillingCodeKeyWords")
    End If

    If sendObj.SetSubject(fp.Subject) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetSubject")
    End If

    If sendObj.SetDeleteAfterSend(0) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetDeleteAfterSend")
    End If


    sendObj.SetPreviewFax (0)
     
    sendObj.ShowSendScreen (0)
    sendObj.ShowCallProgess (0)
     
     
    sendObj.LeaveRunning
     
    If sendObj.SetPrintFromApp(1) = 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in SetPrintFromApp")
    End If
               
    Dim volte As Integer
               
    volte = 0
    While sendObj.IsReadyToPrint() <> 1 And volte < 8
     volte = volte + 1
     Sleep (500)
    Wend

    If sendObj.IsReadyToPrint() <> 1 Then
     Call Err.Raise(9999, "SendFax", "Errore in IsReadyToPrint")
    End If
     

    call PrintMyDocumentOnWinFAXPrinter


    ret = sendObj.Send(1)

    volte = 0
    While sendObj.IsEntryIDReady(0) <> 1 And volte < 20
     volte = volte + 1
     Sleep (200)
    Wend

    If sendObj.IsEntryIDReady(0) = 1 Then
     LogError ("ID Fax " & sendObj.GetEntryID(0))
    Else
     LogError ("Fax senza ID")
    End If

    sendObj.Done

         
    Set sendObj = Nothing
    #4466
    JohnD
    Participant

    Try changing


    volte = 0
    While sendObj.IsReadyToPrint() <> 1 And volte < 8
    volte = volte + 1
    Sleep (500)
    Wend

    “And” to “or”


    volte = 0
    While (sendObj.IsReadyToPrint() <> 1) OR (volte < 8)
    volte = volte + 1
    Sleep (500)
    Wend

    do the same here:


    volte = 0
    While (sendObj.IsEntryIDReady(0) <> 1) OR (volte < 20)
    volte = volte + 1
    Sleep (200)
    Wend

    Edited By JohnD on April 14 2005 at 08:59

    #4467
    Anonymous
    Member
    JohnD wrote:

    thank you for your suggestions, I modified code and now I’m getting double faxes when the outbox is empty.
    Better than before anyway 🙂
    Do you know where I can see more code samples on how to manage fax with Winfax sdk ?

    #4468
    JohnD
    Participant

    @Vincenzo wrote:

    @JohnD wrote:

    thank you for your suggestions, I modified code and now I’m getting double faxes when the outbox is empty.
    Better than before anyway 🙂
    Do you know where I can see more code samples on how to manage fax with Winfax sdk ?

    ? Do you mean you only get a double-fax on the first fax ? and additional faxes are not double?

    if the outbox is empty the first fax created is double?

    #4469
    JohnD
    Participant

    Here are some suggestions, I changed some order of the some of the SendObj commands you used.



    Dim sendObj As Object

    Dim ret As Integer

    Set sendObj = CreateObject("WinFax.SDKSend")

    Call Sleep(2000)

    If sendObj.SetClientID(App.Title) = 1 Then
    Call Err.Raise(9999, "SendFax", "Errore in SetClientID")
    End If
    If sendObj.SetNumber( myfaxnumber ) = 1 Then
    Call Err.Raise(9999, "SendFax", "Errore in SetNumber")
    End If

    If sendObj.SetTo(namepeopleto) = 1 Then
    Call Err.Raise(9999, "SendFax", "Errore in SetTo")
    End If

    'imposto la ditta che deve ricevere
    If sendObj.SetCompany(namefirmto) = 1 Then
    Call Err.Raise(9999, "SendFax", "Errore in SetCompany")
    End If


    If Len(Trim(fp.Data)) > 0 Then
    If sendObj.SetDate(fp.Data) = 1 Then
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.