封送处理 IEnumVARIANT:引用 CustomMarshalers.dll in blob
本文关键字:CustomMarshalers dll in blob 引用 处理 IEnumVARIANT | 更新日期: 2023-09-27 18:35:45
假设我有以下 C# 代码接受带有 IEnumVARIANT 接口的 COM 对象:
public void EnumeratorParameter(
[MarshalAs(UnmanagedType.CustomMarshaler,
MarshalTypeRef = typeof(EnumeratorToEnumVariantMarshaler))]
IEnumerator enumerator) { }
为了封送它,我需要添加对自定义元帅.dll库的引用。但是,与mscorlib.dll
不同的是,此库不是在元数据表中引用AssemblyRef
而是通过FieldMarshal
表在 blob 堆中引用。为什么使用通过 blob 引用?
因为引用出现在 [属性] 中。 实例化属性类时使用的属性数据存储在 Blob 表中。 更多关于这个答案。