I'm trying to send faxes through RightFax COM 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 have registered the DLL file rfcomapi.dll
:
C:\Program Files\RightFAX> RegSvr32 rfcomapi.dll
Unfortunately, when running this code, I get the following error;
Unhandled Exception: system.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I'm using version 9.4.0.0 of RightFax.
How do I fix this problem?
The problem was the server name was incorrect, since we couldn't resolve that name in our network. I pinged the server and I got nothing, however I got the IP address of it and it worked fine!
Always ping the server with RightFax! The error messages you are going to get are not very descriptive!