MethodBuilder.SetMarshal メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

<ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")> _ Public Sub SetMarshal ( _ unmanagedMarshal As UnmanagedMarshal _ )
Dim instance As MethodBuilder Dim unmanagedMarshal As UnmanagedMarshal instance.SetMarshal(unmanagedMarshal)
[ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")] public void SetMarshal ( UnmanagedMarshal unmanagedMarshal )
[ObsoleteAttribute(L"An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")] public: void SetMarshal ( UnmanagedMarshal^ unmanagedMarshal )
/** @attribute ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202") */ public void SetMarshal ( UnmanagedMarshal unmanagedMarshal )
ObsoleteAttribute("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202") public function SetMarshal ( unmanagedMarshal : UnmanagedMarshal )


SetMarshal メソッドを使用して、メソッド呼び出しの結果を別の型としてマーシャリングする方法については、次のコード例を参照してください。
Dim myMethod As MethodBuilder = myDynamicType.DefineMethod("MyMethodReturnsMarshal", _ MethodAttributes.Public, GetType(System.UInt32), _ New Type() {GetType(String)}) ' We want the return value of our dynamic method to be marshalled as ' an 64-bit (8-byte) signed integer, instead of the default 32-bit ' unsigned int as specified above. The UnmanagedMarshal class can perform ' the type conversion. Dim marshalMeAsI8 As UnmanagedMarshal = UnmanagedMarshal.DefineUnmanagedMarshal( _ System.Runtime.InteropServices.UnmanagedType.I8) myMethod.SetMarshal(marshalMeAsI8)
MethodBuilder myMethod = myDynamicType.DefineMethod("MyMethodReturnsMarshal" , MethodAttributes.Public, typeof(uint), new Type[] { typeof(string) }); // We want the return value of our dynamic method to be marshalled as // an 64-bit (8-byte) signed integer, instead of the default 32-bit // unsigned int as specified above. The UnmanagedMarshal class can perform // the type conversion. UnmanagedMarshal marshalMeAsI8 = UnmanagedMarshal.DefineUnmanagedMarshal( System.Runtime.InteropServices.UnmanagedType.I8); myMethod.SetMarshal(marshalMeAsI8);
array<Type^>^ temp0 = { String::typeid }; MethodBuilder^ myMethod = myDynamicType->DefineMethod( "MyMethodReturnsMarshal" , MethodAttributes::Public, UInt32::typeid, temp0 ); // We want the return value of our dynamic method to be marshalled as // an 64-bit (8-Byte) signed integer, instead of the default 32-bit // unsigned int as specified above. The UnmanagedMarshal class can perform // the type conversion. UnmanagedMarshal^ marshalMeAsI8 = UnmanagedMarshal::DefineUnmanagedMarshal( System::Runtime::InteropServices::UnmanagedType::I8 ); myMethod->SetMarshal( marshalMeAsI8 );
MethodBuilder myMethod = myDynamicType.DefineMethod( "MyMethodReturnsMarshal", MethodAttributes.Public, int.class.ToType(), new Type[] { String.class.ToType() }); // We want the return value of our dynamic method to be marshalled as // an 64-bit (8-byte) signed integer, instead of the default 32-bit // unsigned int as specified above. The UnmanagedMarshal class // can perform the type conversion. UnmanagedMarshal marshalMeAsI8 = UnmanagedMarshal.DefineUnmanagedMarshal( System.Runtime.InteropServices.UnmanagedType.I8); myMethod.SetMarshal(marshalMeAsI8);

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からMethodBuilder.SetMarshal メソッドを検索する場合は、下記のリンクをクリックしてください。

- MethodBuilder.SetMarshal メソッドのページへのリンク