473,473 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Faxing

Hi all
I want to send a fax with WebService in vb.net; I use this code to send a fax with FaxService in Windows XP

Dim FXServ As New FAXCOMLib.FaxServe
Dim FXDoc As FAXCOMLib.FaxDo
Dim iFaxJob As Intege

FXServ.Connect("\\localhost"

FXDoc = CType(FXServ.CreateDocument("C:\fax.doc"), FAXCOMLib.FaxDoc

FXDoc.FileName = "C:\fax.doc
FXDoc.FaxNumber = "005056
FXDoc.SenderName = "Fax Test
FXDoc.DisplayName = "Test

iFaxJob = FXDoc.Send(

FXServ.Disconnect(

This code works well in Windows Forms but in Web Forms or in a WebService don’t work. I try different configurations of security, put the code in another assembly and generate a Wrapper for the FAXComLib class as explained in http://support.microsoft.com/default...;en-us;q303647 without any result

Anybody can help me? Thanks in advance

Regard
Joan

Nov 20 '05 #1
2 1805
I am having a similar problem with a Win32 Service (not WebService)...when I run application as stand-alone exe the fax sends fine using the same code you have above, however, when I attempt to run as a service the FXDoc.Send() line hangs indefinately. The same behaviour is seen using FXServer.ConnectedSubmit and FXServer.Commit...I suspect the problem is as follows: When you create a service (Windows or Web), you may include no UI, however, when you try to fax using any method described above you create an instance of Word (or WordPad, or Acrobat, or whatever, depends on document being printed)...since each of these apps have a UI (often you see "printing page X of Y to Fax" window, or the actual document load) I believe the faxing fails...

Sadly I have yet to find a workaround :-(
I am now attempting to fax directly to the FaxMachine's DC using FaxStartPrintJob (in winfax.dll), but am having vast problems converting the C types to VB...If anyone can help in this endevour it would be greatly appreciated...once I have this resolved I will post code snippet here.
Nov 20 '05 #2
Joan et all,
I was able to re-create your problem (if your service, indeed, appears to hang on the 'FXDoc.Send()' line of code
(NOTE: you can test this by putting debug lines before and after the line which print some message to an ASCII file. Please don't forget to close your debugging file BEFORE your 'FXDoc.Send()' line executes! You could also use the EventLog success-audit stuff). (Incidently, I do not believe your code (as listed) will work on Win2K machines, which is how this nightmare began for me)...Here's the ONLY work-around I could find (and I tried quite a few, see previous post):
[Note: Using MSFax from XP, and W2K disks]
I believe one needs to call FaxStartPrintJob API to obtain a Device Context for the faxing job (you also set routing info when you call this API). Once you have successfully called FaxStartPrintJob (non-zero return code), [then FaxPrintCoverPage] you may freely use GDI (and GDI+ I immagine) functionality to send your fax. I cannot seem to send an associated file via service at all (like your .doc file). I believe it has to do with the UI that the associated program uses, but I'm not certain (like Word or Wordpad, whichever handles your server's .doc's). Personally, I hated coding this, it was tedious, and much more code than I needed to send a fax while not running as a service (Win32 or Web). The ONLY benefit I see from the previously described code is it works on both XP and Win2K...If anyone has any alternatives please let us know!!

For additional information on Faxing directly to a device context (unfortunately only talks about C++, but works in VB.Net and VB6) see:
http://msdn.microsoft.com/library/de...egacy_1rzo.asp
(also do not forget to call EndDoc AND DeleteDC NEVER freeDC!!)
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MCL | last post by:
Anybody done this before... I have found a few through web searches but not many... Anybody know of a com object or anything that interfaces with ASP to allow the faxing of messages and web...
0
by: Alex Stevens | last post by:
Hi All, We are looking for a faxing component, which we can drop into an application which would allow the user to send faxes through a faxmodem attached or a shared network modem. We've...
4
by: Bob | last post by:
I was wondering what would be the easiest way to fax a document from within a Windows .NET application. It's not enough to simple print to a fax service device. I want to be able to pass the fax...
0
by: Sam Coburn | last post by:
I want to automate faxing from access 2000 so it'll use the customer's name and fax number to automatically fax to several customers a report. How can I do this or can you point me in the right...
0
by: sachin | last post by:
Hi I am trying to implement faxing through asp.net application on Windows 2000 server. It works when i send a .txt file, but hangs when trying a word or a pdf document. Any idea what the...
0
by: CS | last post by:
Hi all, This is what I am trying to achieve. I am writing a web application to allow my users to submit their documents for faxing. I have tested it using bmp and txt file and both seems to be...
2
by: willl69 | last post by:
Hi, I was just wondering if anyone knows if its possible to set up some sort of remote faxing server using PH P & apache. If not, any other prog languages or server technologies? I know .NET...
0
by: crazytegger | last post by:
Hi, I have an access report that has 2 different images on it. One is embedded, and one is a linked image. The report prints to a local printer just fine. When I try to fax the report (using WinFax)...
1
by: Diffident | last post by:
Hello All, We would like to add faxing capabilities to our application. We need to fax PDF attachments that are generated on-the-fly. Does any one know of any third party tools that have this...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.