TypeLibTypeAttribute クラスとは? わかりやすく解説

TypeLibTypeAttribute クラス

COM タイプ ライブラリからこの型用に元来インポートされた TYPEFLAGS を格納します

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

<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Struct
 Or AttributeTargets.Enum Or AttributeTargets.Interface,
 Inherited:=False)> _
Public NotInheritable Class
 TypeLibTypeAttribute
    Inherits Attribute
Dim instance As TypeLibTypeAttribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface,
 Inherited=false)] 
public sealed class TypeLibTypeAttribute :
 Attribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Struct|AttributeTargets::Enum|AttributeTargets::Interface,
 Inherited=false)] 
public ref class TypeLibTypeAttribute sealed
 : public Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface,
 Inherited=false) */ 
public final class TypeLibTypeAttribute extends
 Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface,
 Inherited=false) 
public final class TypeLibTypeAttribute extends
 Attribute
解説解説

タイプ ライブラリ インポータ (Tlbimp.exe) は、この属性クラスまたはインターフェイス適用します。

この属性タイプ ライブラリインポートされるときに適用され変更されることはありません。適用されるのは、メソッドTYPEFLAGS が 0 以外の場合だけです。この属性は、元の TYPEFLAGSどのように設定されたかを把握する必要のあるツール使用するために設計されています。共通言語ランタイムでは、この属性使用されません。

使用例使用例

クラスまたはインターフェイスTypeLibTypeAttribute 値を取得する方法次の例に示します

Imports System
Imports System.Runtime.InteropServices

Module B
    Public Function IsHiddenInterface(ByVal
 InterfaceType As Type) As Boolean
        Dim InterfaceAttributes As Object()
 = _
        InterfaceType.GetCustomAttributes(GetType(TypeLibTypeAttribute),
 False)

        If InterfaceAttributes.Length > 0 Then
            Dim tlt As TypeLibTypeAttribute
 = InterfaceAttributes(0)
            Dim flags As TypeLibTypeFlags =
 tlt.Value
            Return (flags & TypeLibTypeFlags.FHidden) >
 0
        End If

        Return False
    End Function
End Module
using System;
using System.Runtime.InteropServices;

namespace B
{
    class ClassB    
    {
        public static bool
 IsHiddenInterface( Type InterfaceType )
        {
            object[] InterfaceAttributes = InterfaceType.GetCustomAttributes( typeof(
 TypeLibTypeAttribute ), false );
            if( InterfaceAttributes.Length > 0 )
            {
                TypeLibTypeAttribute tlt = ( TypeLibTypeAttribute ) InterfaceAttributes[0];
                TypeLibTypeFlags  flags = tlt.Value;
                return ( flags & TypeLibTypeFlags.FHidden
 ) != 0; 
            }
            return false;
        }
    }
}
using namespace System;
using namespace System::Runtime::InteropServices;

ref class ClassB
{
private:
   static bool IsHiddenInterface( Type^ InterfaceType
 )
   {
      array<Object^>^InterfaceAttributes = InterfaceType->GetCustomAttributes(
 TypeLibTypeAttribute::typeid, false );
      if ( InterfaceAttributes->Length > 0 )
      {
         TypeLibTypeAttribute^ tlt = dynamic_cast<TypeLibTypeAttribute^>(InterfaceAttributes[
 0 ]);
         TypeLibTypeFlags flags = tlt->Value;
         return (flags & TypeLibTypeFlags::FHidden) != TypeLibTypeFlags(0);
      }

      return false;
   }
};
import System.*;
import System.Runtime.InteropServices.*;

class ClassB
{
    public static boolean IsHiddenInterface(Type
 InterfaceType)
    {
        Object interfaceAttributes[] 
            = InterfaceType.GetCustomAttributes(
            TypeLibTypeAttribute.class.ToType(), false);

        if (interfaceAttributes.length > 0) {
            TypeLibTypeAttribute tlt 
                = (TypeLibTypeAttribute)(interfaceAttributes.get_Item(0));
            TypeLibTypeFlags flags = tlt.get_Value();

            return (int)(flags & TypeLibTypeFlags.FHidden)
 != 0;
        }
        return false;
    } //IsHiddenInterface
} //ClassB
継承階層継承階層
System.Object
   System.Attribute
    System.Runtime.InteropServices.TypeLibTypeAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TypeLibTypeAttribute メンバ
System.Runtime.InteropServices 名前空間
その他の技術情報
タイプ ライブラリ インポータ (Tlbimp.exe)



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TypeLibTypeAttribute クラス」の関連用語

TypeLibTypeAttribute クラスのお隣キーワード
検索ランキング

   

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



TypeLibTypeAttribute クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS