MarshalAsAttribute.MarshalTypeRef 필드

정의

형식으로 구현합니다 MarshalType .

public: Type ^ MarshalTypeRef;
public Type MarshalTypeRef;
public Type? MarshalTypeRef;
[System.Runtime.InteropServices.ComVisible(true)]
public Type MarshalTypeRef;
val mutable MarshalTypeRef : Type
[<System.Runtime.InteropServices.ComVisible(true)>]
val mutable MarshalTypeRef : Type
Public MarshalTypeRef As Type 

필드 값

특성

설명

또는 MarshalType 필드를 사용하여 MarshalTypeRef 특성 매개 변수, 필드 또는 반환 형식에 대한 사용자 지정 마샬러 형식을 지정할 수 있습니다. 필드를 MarshalTypeRef 사용하면 구문을 줄여 사용이 더 MarshalType 쉬워질 수 있습니다. 다음 예제에서 첫 번째 줄은 using MarshalType 구문을 나타내고 두 번째 줄은 을 사용하는 MarshalTypeRef구문을 나타냅니다.

[MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Assembly, NameSpace.TypeName")]
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NameSpace.TypeName))]

C#의 typeof, Visual Basic GetType 또는 C++의 typeid 사용하여 Type 개체를 설정할 수 있습니다.

적용 대상

추가 정보