public void EnableCalbacks(bool onoff) { if (onoff) { ipc.OnFrameInit = new IPC2.delOnFrameInit(OnFrameInit); Int32 u = IPC2.SetCallback_OnFrameInit(0, ipc.OnFrameInit); ipc.OnNewFrameEx = new IPC2.delOnNewFrameEx(OnNewFrameEx); IPC2.SetCallback_OnNewFrameEx(0, ipc.OnNewFrameEx); } else { Int32 u = IPC2.SetCallback_OnFrameInit(0, null); IPC2.SetCallback_OnNewFrameEx(0, null); } }
public bool InitIPC() { try { Int64 hr; if ((ipc != null) && !ipcInitialized) { hr = IPC2.Init(0, ""); if (hr != 0) { ipcInitialized = false; return(false); } else { ipc.OnInitCompleted = new IPC2.delOnInitCompleted(OnInitCompleted); ipc.OnServerStopped = new IPC2.delOnServerStopped(OnServerStopped); IPC2.SetCallback_OnServerStopped(0, ipc.OnServerStopped); ipc.OnFrameInit = new IPC2.delOnFrameInit(OnFrameInit); Int32 u = IPC2.SetCallback_OnFrameInit(0, ipc.OnFrameInit); ipc.OnNewFrameEx = new IPC2.delOnNewFrameEx(OnNewFrameEx); IPC2.SetCallback_OnNewFrameEx(0, ipc.OnNewFrameEx); IPC2.SetCallback_OnInitCompleted(0, ipc.OnInitCompleted); hr = IPC2.Run(0); ipcInitialized = (hr == 0); return(true); } } return(ipcInitialized); } catch (Exception err) { throw (new SystemException(err.Message)); } }