public void BindDevice(string printerName) { try { BidiSpl bidi = (BidiSpl)Activator.CreateInstance(typeof(BidiSpl), true); _iBidiSpl = (IBidiSpl)bidi; _iBidiSpl.BindDevice(printerName, BIDI_ACCESS_USER); } catch (SystemException e) { Console.WriteLine(e.Message); Environment.Exit(-1); } }
public String BindDevice(string printerName) { String BindResponse = String.Empty; try { BidiSpl bidi = (BidiSpl)Activator.CreateInstance(typeof(BidiSpl), true); _iBidiSpl = (IBidiSpl)bidi; _iBidiSpl.BindDevice(printerName, BIDI_ACCESS_USER); } catch (SystemException e) { BindResponse = e.Message; // Console.WriteLine(e.Message); // Environment.Exit(-1); } return(BindResponse); }