Search code examples
c#comaccess-deniedrightfax

Access denied attempting to watch completed events


We're currently using RightFax v9.3.2.89 with the rfcomlib API. Currently, we simply installed RightFax on everyone's computer as the application generating these faxes is on the desktop. Since we're moving to a web solution we will be only installing RightFax on the server. Issue with this is that the users won't be able to see if faxes are successfully sent. Looking at the API I see that I can do something like this:

faxServer.Events.WatchCompleteEvents = BoolType.True;
faxServer.OnCompleteEvent += faxServer_OnCompleteEvent;

The problem is that when I subscribe to watch for completed events I get

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Browsing the web I can see that this error can spring up from a million sources. It's odd because I have administrative rights on my computer.

Any ideas?

Unfortunately, the RightFax site is useless and there's little to no resources available.


Solution

  • I noticed that when using the above method from Ben the status description never updates. The below example will sleep forever showing a status of "Waiting for Conversion" even though in FaxUtil the fax was clearly sent and has a status of "OK".

    fax.Send();
    
    while (fax.StatusDescription != "OK")
    {
        Console.WriteLine("Polling fax handle " + fax.Handle.ToString() 
                       + " for status. Found: " + fax.StatusDescription);
        Thread.Sleep(5000);
    }
    

    I will second that the RightFax API has no documentation and is tough to work with. I hope this helps the original poster.