private static int Commit(IntPtr thisPtr, uint grfCommitFlags) { try { Interop.Ole32.IStream instance = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); instance.Commit((Interop.Ole32.STGC)grfCommitFlags); return(S_OK); } catch (Exception ex) { Debug.WriteLine(ex); return(ex.HResult); } }
private static int Commit(IntPtr thisPtr, uint grfCommitFlags) { try { Interop.Ole32.IStream inst = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); inst.Commit(grfCommitFlags); } catch (Exception e) { return(e.HResult); } return(S_OK); }
protected override void Dispose(bool disposing) { try { if (disposing && comStream != null) { try { comStream.Commit(Interop.Ole32.STGC.STGC_DEFAULT); } catch (Exception) { } } // Can't release a COM stream from the finalizer thread. comStream = null; } finally { base.Dispose(disposing); } }