- This topic is empty.
-
AuthorPosts
-
November 26, 2007 at 5:16 pm #2545
lmeinecke
MemberCurrently running vb.net application to automatically batch process faxes through WinFax Pro 10.04 on a XP SP2 machine. The application passess all of the required info to Winfax (number, name, etc.) to send the fax. This problem did not occur when running 10.01 and 2003 Server. Periodically during the batch process, the WinFax send screen window pops up with no info in any of the boxes and the fax attachment displayed in the bottom. This window should not pop up as the code is in place not to show it. This obviously freezes the whole process of sending faxes out automatically and unattended. We’ve added numerous objWinfax.ShowSendScreen(0) throughout the code to stop it with no luck. We can not find anything with the data being passed as the cause and the number of times this happens and when it happens is totally random. Anyone have any ideas?
November 26, 2007 at 11:37 pm #4287Administrator
KeymasterWe’ve done much troubleshooting with custom code, and usually the issue is with a problem in the code (which might work fine in the development os) but will fail on other operating systems, like it has in your case. It may be as simple as a timing issue, or a little more complex if you are printing from another application.
November 27, 2007 at 12:51 pm #4288lmeinecke
MemberHere is the code (the database query has been removed) that we are currently using. Basically, the batch vb.net exe program creates a group of .pdf files and then we process them out of the directory. We use the pdf file name to hold the data to search the database to get all of the fax info.
files = System.IO.Directory.GetFiles(“C:Fax”, “*pdf”)
Array.Sort(files)
For Each file_name In files
If System.IO.File.Exists(file_name) = True Then
strOrder = Mid(file_name, 48, 10)
strCIX = Mid(file_name, 33, 10)
strPlantNum2 = Mid(file_name, 44, 3)
If strPlantNum2 = “543” Then
strPlantCIX = strCIX & “-” & strPlantNum2 & “-” & strOrder
Else
strPlantCIX = strCIX & “-” & strPlantNum2
End If
If strPlantCIX <> str_prev_PlantCIX Then
str_prev_PlantCIX = strPlantCIX
strOX = “SELECT FROM DATABASE QUERY”
Try
rsOX = CONN2.Execute(strOX)
Catch ex As Exception
PrintLine(1, “[” & Now() & “] N:”, ex.Message, ex.StackTrace)
End Try
While Not rsOX.EOF
Dim objWinfax As New wfxctl32.CSDKSend
objWinfax.ShowSendScreen(0)
objWinfax.SetClientID(“CTR”)
Dim header_info()
objWinfax.ShowSendScreen(0)
objWinfax.SetSubject(“XXXXX”)
objWinfax.ShowSendScreen(0)
objWinfax.SetTo(rsOPEX.Fields(“CONTACT_NAME”).Value)
objWinfax.ShowSendScreen(0)
objWinfax.SetCompany(strCIX)
objWinfax.ShowSendScreen(0)
objWinfax.EnableBillingCodeKeyWords(1)
objWinfax.ShowSendScreen(0)
objWinfax.SetBillingCode(strPlantNum2)
objWinfax.ShowSendScreen(0)
objWinfax.SetNumber(“9,1” & rsOPEX.Fields(“FAX_NUMBER”).Value)
attach_num = 0
objWinfax.ShowSendScreen(0)
Dim Attach_Array() As String
Attach_Array = System.IO.Directory.GetFiles(“C:Fax”, “*” & strPlantCIX & “*pdf”)
ctr_s = 0
For Each Attachment In Attach_Array
objWinfax.ShowSendScreen(0)
attach_num = attach_num + 1
objWinfax.AddAttachmentFile(Attachment)
objWinfax.ShowSendScreen(0)
just_path = Mid(Attachment, 1, 32)
just_file = Mid(Attachment, 33, 70)
System.IO.File.Copy(Attachment, just_path & “Sent” & just_file, True)
PrintLine(1, “[” & Now() & “] Faxing: ” & Attachment)
ctr_s = ctr_s + 1
Next
objWinfax.ShowSendScreen(0)
objWinfax.AddRecipient()
objWinfax.ShowSendScreen(0)
objWinfax.Send(0)
objWinfax.ShowSendScreen(0)
objWinfax.Done()
objWinfax = Nothing
header_info = Nothing
rsOX.MoveNext()
End While
End If
GC.Collect()
End If
Next
End IfNovember 30, 2007 at 8:50 pm #4289JohnD
Participanthere are a few suggestions,
remove the duplicate ShowSendScreen(0) items you added. they won’t resolve the issue, adding them can cause other problems. You should only have to use this once in your code.
Try using Send(1) instead of Send(0) so it returns an EntryID which you can check for. You need to wait until WinFax has processed the PDF files, or other attachments before you use the .Done() method , or have set objWinFax object=Nothing. You need to add the appropriate code for this.
Shortcuts in your existing code don’t always translate well when you move to a different operating system. Its best to do it right the first time so you don’t run into problems in the future.
November 30, 2007 at 9:02 pm #4290lmeinecke
MemberI did what you suggested two days ago and changed the tail end of the code section to include this:
objWinfax.AddRecipient()
objWinfax.Send(1)
Do While objWinfax.IsEntryIDReady(0) <> 1
Application.DoEvents()
Loop
objWinfax.Done()I also changed my If condition on the file processing to not break the jobs down into so many. The job ran considerably longer than it has in a while before the send screen popped up. With the handle issue in 10.04 and other memory leak issues we had with 10.01 on 2003, I’m wondering if WinFax Pro can’t handle the volumn of faxes I’m sending in one shot. I got through about 900 documents for about 100 destinations before the send screen popped up. Any thoughts on that possibility?
December 6, 2007 at 11:18 pm #4291Administrator
KeymasterI’d recommend adding some error logging and the loop should exit after a period of time otherwise it is stuck if no entry id is returned. 100 faxes with 9 pages approx. each (900 pages) shouldn’t be a problem with WinFax
Also remove the Done() function, I don’t believe it is required. -
AuthorPosts
- You must be logged in to reply to this topic.