FaxComExLib Com error
I have created a small test program for faxing. On some machines it works and on others it throws the following COM error when trying to send the fax:
"System.Runtime.InteropServices.COMException (0x80070483): Operation failed. at FAXCOMEXLib.FaxDocumentClass.ConnectedSubmit(FaxServer pFaxServer) at FaxTest.Form1.Button1_Click(Object sender, EventArgs e) in D:\Test\FaxTest\Form1.vb:line 25"
Here is the source code from my test application. All it requires is a reference to FaxComExLib.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim obj() As Object
Dim PriorityEnum As FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM
'Specify FaxServer Name
objFaxServer.Connect("jupiterp2003")
PriorityEnum = CType(1, FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM)
objFaxDocument.Recipients.Add("555-5555", "taco")
objFaxDocument.Sender.Company = "company"
objFaxDocument.Priority = PriorityEnum
objFaxDocument.Subject = "test subject"
objFaxDocument.Note = "note"
objFaxDocument.Sender.Name = "this guy"
'Test Tiff to send
objFaxDocument.Body = "c:\FaxTest\merge.tif"
''''
'THROWS COM ERROR ON SOME MACHINES
obj = DirectCast(objFaxDocument.ConnectedSubmit(objFaxServer), Object())
''''
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
Anybody know what I'm doing wrong or know how to fix the error? Any help would be greatly appreciated.
Thanks.
I think that maybe the problem is that you are sending a not Group 3 FAX Format, Facsimile Formats or Group 4 FAX Format.
The Faxserver interpreter take any tif file and send it as it is (do not transform tif files), if this file is not formated in Facsimile format, it will give you a problem. If the file comes with another format like pdf or word, the faxserver will take the word or pdf (distiller) converter engine to transform it in tif ( Group 3 FAX Format, Facsimile Formats or Group 4 FAX Format). Try with another file type or take an incoming fax and use it to send it again.
Good Luck!
Hi,
I am having the same problem with the "operation failed"; Just to keep the story short - my original intentions was to send a PDF file to fax in a webpage; However, since PDF needs to have acrobat reader open and emulates a print, I am getting problems on a web server. So I am now using Ghostscript to convert from PDF to TIFF (tiffg4); While this works perfectly, when I look in the fax console - in the outbox, it looks perfect as I would expect, in the sent items, its a corrupted output, with only the header visible. I have got the actual printout at the fax machine, same thing.
I have now confirmed that it is the format - tested by using a VB.NET Windows App and attached the same file i.e. TIF01.tif is a Group 4 Fax Format and it has the scramble/corruption issue - TIF02.tif is a Group 3 Fax Format (i.e. the one used in the fax console of an incoming fax and saved); I can sumbit both TIF01.tif and TIF02.tif using VB.NET Windows App and TIF01.tif will become corrupt after sending, and TIF02 is perfect. However, under ASP.NET / Web App, I can't submit TIF02.tif - it returns operation failed - which is a file format issue. Is there a way I can test which file format it needs to be in ?
Thankx
Thomas
Hi,
I am having the same problem. with "Operation failed". I use the word file to be sent on fax using fax modem of D-link DFM-560E. My os is windows 2003 standard edition. The code is given below.
Dim
Fs As New FAXCOMEXLib.FaxServer
Dim fd As New FAXCOMEXLib.FaxDocument
Fs.Connect("backup_imail")
fd.Body = "C:\Inetpub\wwwroot\Fax1\hh.doc"
fd.Recipients.Add(
"63,9084509299", "Phil Leisure")fd.ConnectedSubmit(Fs)Fs.Disconnect()
but getting the error same as u get. The doc file is not coverted to .Tif file but when i use .Txt file it is converted to .Tif file and fax is succesful sent. So i require your help in this to solve this porblem.
Thankx in advance
Mitesh Pate
I've written a cgi that runs on an intranet here. It creates a PDF (Purchase order) file from a report and the intention is then to fax the PDF to the supplier. The PDFs get created successfully and the first one gets faxed successfully too. The only problem is, if I try to fax any more PDFs in the same way then the CGI just hangs waiting for a response from the server. When you look at the Processes in Task Manager that are running on the server, the AcroRd32.exe process persists...even after the cgi has timed out. I'm using Microsoft Fax Console - that comes with Windows 2003 SBS. I think what's happening is that the PDF is being created, but then the Fax Server uses AcroRd32 to load it up & convert it to Tiff to send. I think it's this process that's causing the problem.
If I take out the code from the CGI that sends the faxes, all the PDFs are created without any problems...so I know that bit of the code works fine.
Initially I had Acrobat 5(!) installed on the Server. I tried upgrading by downloading the latest version (Acrobat 8), but this has made no difference. I've also tried unchecking the "Display PDF in browser" setting in the preferences of Adobe Acrobat Reader, but this hasn't made any difference either. I'm a bit stuck...Any help or advice gratefully received...I guess this may be a problem with the Fax Server/Console...but as far as I can tell it's just as likely to be a problem with AcroRd32.exe?
It sounds very similar to the problem you were having last year...just thought you might be able to help!
Thanks in advance,
Richard.
I just tweaked my CGI slightly to prove that something's going wrong when the Fax Server loads and converts the PDF to Tiff. I left it so that the PDF is created and modified the bit that sends the fax so that instead of sending the pdf, it sends a simple "Hello.txt" file. This time the fax went through without any problems...it's just not the fax that I want to send!!! How can I get the Fax Server to reliably send pdfs?
Thanks again,
Richard
Hi Richard,
We have written the same application using .NET (Purchase Order system) and I think you are on the right track. We got around it by having Acrobat 4 installed on our server and we generate the Acrobat files with the extension pdf4.
The reason we have done this is as you mentioned, acrobat 5 and above doesn't automatically terminate after print, hence it does not response with an exit code for the server to terminate.
How we have done it is setup a web service on the server with the fax card / fax console, installed Acrobat Reader 4, created a file assoication to .pdf4 extension (which we generate out of our app), ie. Under the "File Type" for PDF4, we have created a "printto" action, and the program is C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe /t %1 %2 %3 %4
Use DDE, Application = AcroRd32 and Topic = System
From what I understand, the /t option asks it to terminate after print; when you submit a job to the Fax Console, it opens out the assoicated viewer and issue a "printto" command so that it emulates what you are doing if you had print the document to that printer.
This has got us around it and we have not had any problems in the last 6 months. Hope this helps.
Thomas
Thomas,
Thank you so much! I did exactly as you described and it works perfectly now! As you say, I was working along the right lines. I just hadn't expected to have to use an older version of Adobe Acrobat to make it work...I'd gone for a more recent version.
This will save our purchasing team hours every day hovering over the fax machine...next step is to try and convince our suppliers to start receiving Purchase Orders electronically rather than by fax!
Thanks again,
Richard.
Hi Mitesh,
Sorry for deviating from the topic here. I have been desperately looking for the win 2K3 driver for DFM-560E modem. It would be nice if you can send it to me or point me to the download link.
BTW, I tried installing the standard windows driver for 56 kbps modems but it does not work. It fails at initializing the modem.
regards,
Raj