Question Problem with sending Fax from Windows Service

deveshwani

New member
Joined
Jul 11, 2011
Messages
1
Programming Experience
5-10
I am trying to send the fax from my windows service which is written in vb.net. I am facing problem with windows 7 and windows 2008 Server. It works fine with Windows XP


Fax is not getting visible in fax console's outbox. I saw three files in "C:\ProgramData\Microsoft\Windows NT\MSFax\Queue" for every sent fax but this is not visible in fax queue.


I also observed that, when i am trying to send the fax from windows application then it works but anyhow it is getting failed when i am trying to send that from windows service.


I have following code :


Dim oFaxSvrType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxServer")
Dim oFaxSvr As Object = Activator.CreateInstance(oFaxSvrType)
Dim oFaxDocType As Type = Type.GetTypeFromProgID("FaxcomEx.FaxDocument")


Dim sFaxServerName As String


Try
sFaxServerName = Environment.MachineName.Trim


oFaxSvr.Connect(sFaxServerName)
oFaxSvr.Connect(sFaxServerName)


Dim oFaxDoc As Object = Activator.CreateInstance(oFaxDocType)
With oFaxDoc
.Sender.FaxNumber = "1112223333"
.Body = asfilename
.Sender.Name = "test recipient"
.Sender.OfficePhone = "123456789"
.Recipients.add("1113332222")
End With


Dim sFaxJobIds() As String = oFaxDoc.ConnectedSubmit(oFaxSvr)
oFaxDoc = Nothing


Catch ex As Exception
Throw New Exception(ex.Message)
Finally
' clean up com components
Try
oFaxSvr.Disconnect()
Catch ex As Exception
End Try
oFaxSvr = Nothing
End Try




I observed that in task manager, rundll32.exe is getting started when i tried to run this code from windows application but this rundll32.exe is not getting started when i am trying to run this code from windows service.


I am not getting any exception after executing this code but not able to see the fax on outbox.


I ensured that allow service to interact with desktop in service console is checked for fax service and my own windows service.


I need this little bit urgent. Any help ?
 
Back
Top