I am attempting to automate faxing using the Rightfax API RFCOMAPI.DLL. I have followed the instructions detail by detail and cannot seem to get this working.
RightFax 10.6 is installed on the machine. I have copied the rfcomapi.dll, rfwin32.dll, rfi32rpc.ndr, rfi32rpc.dll and rfstat.dll as instructed and registered the rfcomapi.dll.
I also make sure that the Microsoft VC++ 2008, 2010 and 2012 redistributables are installed on the machine.
Using sample code that I found here (and on multiple other sites) I am getting an error.
Oh and the user that I am logged in with has a RightFax account.
This is the code block, replacing the server name, etc. with our rightfax server. I've also changed from cpNamedPipes to TCIP without success. It is as if it does not even see the library even though it is clearly there and registered successfully.
RFCOMAPILib.FaxServerClass faxserver = new RFCOMAPILib.FaxServerClass();
faxserver.ServerName = "ServerName";
faxserver.Protocol = RFCOMAPILib.CommunicationProtocolType.cpNamedPipes;
faxserver.UseNTAuthentication = RFCOMAPILib.BoolType.True;
faxserver.OpenServer();
RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax) faxserver.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);
// set up your 'fax' object the way you want it, below is just some sample options
fax.ToName = "John Doe";
fax.ToFaxNumber = "4255551111";
fax.ToVoiceNumber = "4255550000";
fax.ToCompany = "ACME";
fax.FromName = "My Company";
fax.FromVoiceNumber = "4255552222";
fax.Send();
Here is my error:
An expression was expected after '('. At line:1 char:71 + rfcomapilib.faxserverclass faxserver = new rfcomapilib.faxserverclass( <<<< )
Any help or suggestions would be greatly appreciated!!
Thank you