MarshalAsAttribute.MarshalTypeRef フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MarshalAsAttribute.MarshalTypeRef フィールドの意味・解説 

MarshalAsAttribute.MarshalTypeRef フィールド

MarshalAsAttribute.MarshalType を型として実装します。

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public MarshalTypeRef As Type
Dim instance As MarshalAsAttribute
Dim value As Type

value = instance.MarshalTypeRef

instance.MarshalTypeRef = value
[ComVisibleAttribute(true)] 
public Type MarshalTypeRef
[ComVisibleAttribute(true)] 
public:
Type^ MarshalTypeRef
/** @attribute ComVisibleAttribute(true) */ 
public Type MarshalTypeRef
ComVisibleAttribute(true) 
public var MarshalTypeRef : Type
解説解説

属性付きのパラメータ、フィールド、または戻り値の型のカスタム マーシャラ型を指定するときは、MarshalTypeRef フィールドと MarshalType フィールドのいずれかを使用できます。MarshalTypeRef フィールドは、構文を簡略化することによって、MarshalType をより簡単に使用できるようにします。次の例の 1 行目は MarshalType を使用する場合の構文、2 行目は MarshalTypeRef を使用する場合の構文です。

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

Type オブジェクトを設定するには、C# では typeof を、Visual Basic では GetType を、C++ では typeid を使用できます。カスタム マーシャラの作成方法と使用方法の詳細については、「カスタム マーシャリング」を参照してください。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MarshalAsAttribute クラス
MarshalAsAttribute メンバ
System.Runtime.InteropServices 名前空間
MarshalType



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「MarshalAsAttribute.MarshalTypeRef フィールド」の関連用語

MarshalAsAttribute.MarshalTypeRef フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MarshalAsAttribute.MarshalTypeRef フィールドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS