UnmanagedMarshal クラス

定義

注意事項

An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202

マネージド コードからアンマネージド コードにフィールドをマーシャリングする方法を説明するクラスを表します。 このクラスは継承できません。

public ref class UnmanagedMarshal sealed
[System.Serializable]
public sealed class UnmanagedMarshal
[System.Serializable]
[System.Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class UnmanagedMarshal
[<System.Serializable>]
type UnmanagedMarshal = class
[<System.Serializable>]
[<System.Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type UnmanagedMarshal = class
Public NotInheritable Class UnmanagedMarshal
継承
UnmanagedMarshal
属性

注釈

このコード例は、この古い型の回避策を示しています。

マーシャリングは、リモート プロシージャ 呼び出しが発生できるように、パラメーターをパッケージ化およびアンパックするプロセスです。 マーシャリング中に、マネージド型の形式が対応するアンマネージ型の形式と異なる場合、フィールドの形式変換が行われる場合があります。 たとえば、 String 型をアンマネージ BSTR としてマーシャリングできます。 一部の形式変換は、ランタイムによって自動的に処理されます。 既定の動作をオーバーライドするには、 UnmanagedMarshal クラスを使用して形式変換を定義する必要があります。

プロパティ

名前 説明
BaseType
古い.

アンマネージ基本型を取得します。 このプロパティは読み取り専用です。

ElementCount
古い.

数値要素を取得します。 このプロパティは読み取り専用です。

GetUnmanagedType
古い.

アンマネージ型を示します。 このプロパティは読み取り専用です。

IIDGuid
古い.

GUID を取得します。 このプロパティは読み取り専用です。

メソッド

名前 説明
DefineByValArray(Int32)
古い.

アンマネージ コードにマーシャリングする固定長配列 (ByValArray) を指定します。

DefineByValTStr(Int32)
古い.

アンマネージ コードにマーシャリングする固定配列バッファー (ByValTStr) 内の文字列を指定します。

DefineLPArray(UnmanagedType)
古い.

アンマネージ コードにマーシャリングする LPArray を指定します。 LPArrayの長さは、実際にマーシャリングされた配列のサイズによって実行時に決定されます。

DefineSafeArray(UnmanagedType)
古い.

アンマネージ コードにマーシャリングする SafeArray を指定します。

DefineUnmanagedMarshal(UnmanagedType)
古い.

アンマネージ コードにマーシャリングする特定の型を指定します。

Equals(Object)
古い.

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()
古い.

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()
古い.

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()
古い.

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()
古い.

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください