Code snippet to convert JobID from MS Fax API


Here’s a quick little code snippet which will convert a job ID into the correct format when you’re using the MS faxcomexlib.dll. This is needed because you’ll get different formats back from a ConnectedSubmit depending on whether your application is running on Windows XP or Windows 2003 Server. However, the format does not vary when you get status change events.

        private string ConvertJobID(string jobID)       {           string hexJobId = string.Empty;

           try           {               Int64 i = Convert.ToInt64(jobID);               //Match event handler format:                //        hex number; lowercase;                //        no leading zeroes;                //        no "0x" or other prefix                hexJobId = i.ToString("x");           }           catch // If there's an exception,                  // then the Job ID is already correct            {               hexJobId = jobID;           }

           return hexJobId;       }
 

Technorati tags: , , ,

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

 

About Me

I am a Philadelphia-area .NET developer, Microsoft MVP, husband, dad, and geek. I am currently a software engineer at Eclipsys Corporation. I have over 15 years of software development experience in the Healthcare and Manufacturing industries.

More...

Categories

Archives