private static void unload_DLL() { string emuapi = "emuapi"; int hVal = MySabreAPI.GetModuleHandle(ref emuapi); if (hVal != 0) { while (MySabreAPI.FreeLibrary(hVal)) { } } }
private void CloseObjects() { if (this.InvokeRequired) { this.Invoke(new SenderInvoker(CloseObjects)); } else { try { int IsDisconnected; mySabreAPI = null; IsDisconnected = MySabreAPI.clientDisconnect(); } catch { } try { string emuapi = "emuapi"; int hVal = MySabreAPI.GetModuleHandle(ref emuapi); if (hVal != 0) { while (MySabreAPI.FreeLibrary(hVal)) { } } } catch {} Application.Exit(); frmLogin frm = (frmLogin)Application.OpenForms["frmLogin"]; if (frm != null) { frm.Dispose(); } } }