mirror of https://github.com/dahall/Vanara.git
Added workaround for missing function in .NET Std 2.0
parent
457a71d750
commit
a8e15280e1
|
@ -45,7 +45,11 @@ namespace Vanara.InteropServices
|
|||
var result = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
#if NETSTANDARD2_0
|
||||
result = Marshal.GetComInterfaceForObject(target, typeof(IDispatch));
|
||||
#else
|
||||
result = Marshal.GetIDispatchForObject(target);
|
||||
#endif
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -55,5 +59,10 @@ namespace Vanara.InteropServices
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#if NETSTANDARD2_0
|
||||
[ComImport, Guid("00020400-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
|
||||
private interface IDispatch { }
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue