LCIDConversionAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<ComVisibleAttribute(True)> _ <AttributeUsageAttribute(AttributeTargets.Method, Inherited:=False)> _ Public NotInheritable Class LCIDConversionAttribute Inherits Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Method, Inherited=false)] public sealed class LCIDConversionAttribute : Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets::Method, Inherited=false)] public ref class LCIDConversionAttribute sealed : public Attribute

この属性は、マーシャラが、指定されたメソッド引数の後に LCID を渡すことを要求することを示します。マネージ コードからアンマネージ コードへの呼び出しが行われるときに、マーシャラが引数 LCID を自動的に指定します。

LCIDConversionAttribute に指定されるさまざまな値に応じて、シグネチャが変化するようすを次の例に示します。
Imports System Imports System.Runtime.InteropServices Imports System.Reflection Class LCIDAttrSampler Const LCID_INSTALLED As Integer = 1 Const LCID_SUPPORTED As Integer = 2 <DllImport("KERNEL32.DLL", EntryPoint:="IsValidLocale", _ SetLastError:=True, CharSet:=CharSet.Unicode, _ CallingConvention:=CallingConvention.StdCall), _ LCIDConversionAttribute(0)> _ Public Shared Function IsValidLocale(ByVal dwFlags As Integer) As Boolean End Function Public Sub CheckCurrentLCID() Dim mthIfo As MethodInfo = Me.GetType().GetMethod("IsValidLocale") Dim attr As Attribute = Attribute.GetCustomAttribute(mthIfo, GetType(LCIDConversionAttribute)) If Not(attr Is Nothing) Then Dim lcidAttr As LCIDConversionAttribute = CType(attr, LCIDConversionAttribute) Console.WriteLine("Position of the LCID argument in the unmanaged signature: " + lcidAttr.Value.ToString()) End If Dim res As Boolean = IsValidLocale(LCID_INSTALLED) Console.WriteLine("Result LCID_INSTALLED " + res.ToString()) res = IsValidLocale(LCID_SUPPORTED) Console.WriteLine("Result LCID_SUPPORTED " + res.ToString()) End Sub Public Shared Sub Main() Dim smpl As LCIDAttrSampler = New LCIDAttrSampler() smpl.CheckCurrentLCID() End Sub End Class
using System; using System.Runtime.InteropServices; using System.Reflection; class LCIDAttrSample { private const int LCID_INSTALLED = 1; private const int LCID_SUPPORTED = 2; [DllImport("KERNEL32.DLL", EntryPoint="IsValidLocale", SetLastError = true, CharSet = CharSet.Auto)] [LCIDConversionAttribute(0)] // Position of the LCID argument public static extern bool IsValidLocale( uint dwFlags // options ); public void CheckCurrentLCID() { MethodInfo mthIfo = this.GetType().GetMethod("IsValidLocale"); Attribute attr = Attribute.GetCustomAttribute(mthIfo,typeof(LCIDConversionAttribute)); if( attr != null) { LCIDConversionAttribute lcidAttr = (LCIDConversionAttribute)attr; Console.WriteLine("Position of the LCID argument in the unmanaged signature: " + lcidAttr.Value.ToString()); } bool res = IsValidLocale(LCID_INSTALLED); Console.WriteLine("Result LCID_INSTALLED " + res.ToString()); res = IsValidLocale(LCID_SUPPORTED); Console.WriteLine("Result LCID_SUPPORTED " + res.ToString()); } static void Main(string[] args) { LCIDAttrSample smpl = new LCIDAttrSample(); smpl.CheckCurrentLCID(); } }
using namespace System; using namespace System::Runtime::InteropServices; using namespace System::Reflection; #define LCID_INSTALLED 1 #define LCID_SUPPORTED 2 ref class LCIDAttrSample { public: // Position of the LCID argument [DllImport("KERNEL32.DLL",EntryPoint="IsValidLocale",SetLastError=true ,CharSet=CharSet::Auto)] [LCIDConversionAttribute(0)] static bool IsValidLocale( int dwFlags ); // options void CheckCurrentLCID() { MethodInfo^ mthIfo = this->GetType()->GetMethod( "IsValidLocale" ); Attribute^ attr = Attribute::GetCustomAttribute( mthIfo, LCIDConversionAttribute::typeid ); if ( attr != nullptr ) { LCIDConversionAttribute^ lcidAttr = dynamic_cast<LCIDConversionAttribute^>(attr); Console::WriteLine( "Position of the LCID argument in the unmanaged signature: {0}", lcidAttr->Value ); } bool res = IsValidLocale( LCID_INSTALLED ); Console::WriteLine( "Result LCID_INSTALLED {0}", res ); res = IsValidLocale( LCID_SUPPORTED ); Console::WriteLine( "Result LCID_SUPPORTED {0}", res ); } }; int main() { LCIDAttrSample^ smpl = gcnew LCIDAttrSample; smpl->CheckCurrentLCID(); }
import System.*; import System.Runtime.InteropServices.*; import System.Reflection.*; class LCIDAttrSample { private static final int LCID_INSTALLED = 1; private static final int LCID_SUPPORTED = 2; /** @attribute DllImport("KERNEL32.DLL", EntryPoint = "IsValidLocale" , SetLastError = true, CharSet = CharSet.Auto) */ /** @attribute LCIDConversionAttribute(0) */ public static native boolean IsValidLocale(int dwFlags); // Position of the LCID argument options public void CheckCurrentLCID() { MethodInfo mthIfo = this.GetType().GetMethod("IsValidLocale"); Attribute attr = Attribute.GetCustomAttribute(mthIfo, LCIDConversionAttribute.class.ToType()); if (attr != null) { LCIDConversionAttribute lcidAttr = (LCIDConversionAttribute)attr; Console.WriteLine("Position of the LCID argument in the unmanaged " + "signature: " + System.Convert.ToString(lcidAttr.get_Value())); } boolean res = IsValidLocale(LCID_INSTALLED); Console.WriteLine("Result LCID_INSTALLED " + System.Convert.ToString(res)); res = IsValidLocale(LCID_SUPPORTED); Console.WriteLine("Result LCID_SUPPORTED " + System.Convert.ToString(res)); } //CheckCurrentLCID public static void main(String[] args) { LCIDAttrSample smpl = new LCIDAttrSample(); smpl.CheckCurrentLCID(); } //main } //LCIDAttrSample

System.Attribute
System.Runtime.InteropServices.LCIDConversionAttribute


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


LCIDConversionAttribute コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)


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


LCIDConversionAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Value | アンマネージ シグネチャ内での引数 LCID の位置を取得します。 |

LCIDConversionAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

LCIDConversionAttribute メンバ
メソッドのアンマネージ シグネチャにロケール識別子 (LCID) パラメータが必要であることを示します。
LCIDConversionAttribute データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | LCIDConversionAttribute | アンマネージ シグネチャ内での LCID の位置を指定して、LCIDConversionAttribute クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Value | アンマネージ シグネチャ内での引数 LCID の位置を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

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

- LCIDConversionAttributeのページへのリンク