Automating Faxing using RFCOMAPI.DLL
<p>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.   </p>

<p>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.</p>

<p>I also make sure that the Microsoft VC++ 2008, 2010 and 2012 redistributables are installed on the machine.</p>

<p>Using sample code that I found here (and on multiple other sites) I am getting an error.</p>

<p>Oh and the user that I am logged in with has a RightFax account.</p>

<p>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.  </p>

<pre><code>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();
</code></pre>

<p>Here is my error:</p>

<p>An expression was expected after '('.
At line:1 char:71
+ rfcomapilib.faxserverclass faxserver = new rfcomapilib.faxserverclass( &lt;&lt;&lt;&lt; )</p>

<p>Any help or suggestions would be greatly appreciated!!</p>

<p>Thank you</p>