Using FaxJob::SetStatus method in C# requires Job Command enumeration from WinFax.h library

  • Thread starter Thread starter Flea_
  • Start date Start date
F

Flea_

Guest
I am needing to write a console app to delete fax jobs from the Windows Fax Console. I am using the FAXCOMLIB.dll in my C# project which provides me access to the Fax Service Client API which is found here. I am specifically using the IFaxJob::SetStatus method which has this documentation. According to the documentation I need to pass in a Job Command enumeration value (JC) such as JC_DELETE, however, I am not able to see where these enums are exposed in C# on the FAXCOMLIB.dll. When I look up the WinFax.h file I can see the enum in there and its declared as this


typedef enum
{
JC_UNKNOWN = 0,
JC_DELETE,
JC_PAUSE,
JC_RESUME
} FAX_ENUM_JOB_COMMANDS;

I tried just plugging in int value 1 for delete but I then receive an exception {"The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))"}

I am hoping someone smarter than I can help me resolve this by either being able to call this enum some how (perhaps I have to someone bring in the header file to my project) or by someone passing a value the method likes.

Here is my code block, which does work. I do get the job from the console:


var job = this.getFaxJobsInQueue().Where(j => j.JobId == JobId).Single();

job.SetStatus(1);

Continue reading...
 
Back
Top