1 // ManagedErrorInfo class
3 // Eberhard Beilharz (eb1@sil.org)
5 // Copyright (C) 2012 SIL International
7 using System.Runtime.CompilerServices;
10 namespace System.Runtime.InteropServices
13 /// Helper class that allows to pass an exception as an IErrorInfo object. This is useful
14 /// when we get an exception in managed code that is called from unmanaged code that is called
15 /// from managed code and we want to get to the exception in the outer managed code.
17 internal class ManagedErrorInfo: IErrorInfo
19 private Exception m_Exception;
20 public ManagedErrorInfo (Exception e)
25 public Exception Exception {
26 get { return m_Exception; }
30 public int GetGUID (out Guid guid)
37 public int GetSource (out string source)
39 source = m_Exception.Source;
43 public int GetDescription (out string description)
45 description = m_Exception.Message;
49 public int GetHelpFile (out string helpFile)
51 helpFile = m_Exception.HelpLink;
55 public int GetHelpContext(out uint helpContext)