Getting a SystemOccessViolationException in C # Using RightFax

I am trying to send faxes through the RightFax API API library:

RFCOMAPILib.FaxServer server = new RFCOMAPILib.FaxServer(); server.ServerName = "xxx"; server.Protocol = CommunicationProtocolType.cpTCPIP; server.UseNTAuthentication = BoolType.True; // Error happens here server.OpenServer(); RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax)server.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax); fax.ToName = "Batman"; fax.ToFaxNumber = "23434484"; fax.FromFaxNumber = "78678676"; fax.FromName = "Robin"; fax.Send(); 

I registered the dll file rfcomapi.dll :

 C:\Program Files\RightFAX> RegSvr32 rfcomapi.dll 

Unfortunately, when I run this code, I get the following error:

Unhandled exception: system.AccessViolationException: Attempted to read or write protected memory. This often indicates that another memory is corrupted.

I am using version 9.4.0.0 of RightFax.

How to fix this problem?

+4
source share
2 answers

The problem was the wrong server name, because we could not resolve this name on our network. I ping a server and I have nothing, however I have an IP address and it worked fine!

Always ping a server using RightFax! The error messages you are about to receive are not very descriptive!

+1
source

Your code itself is perfect. I can run it with 9.4 RightFax without any problems. You can check your authorization to make sure that your account is fully authorized on the server.

+1
source

Source: https://habr.com/ru/post/1332444/


All Articles