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!!)