Share via


Type.GetTypeFromCLSID メソッド

指定したクラス ID (CLSID) に関連付けられている型を取得します。

オーバーロードの一覧

指定したクラス ID (CLSID) に関連付けられている型を取得します。

[Visual Basic] Overloads Public Shared Function GetTypeFromCLSID(Guid) As Type

[C#] public static Type GetTypeFromCLSID(Guid);

[C++] public: static Type* GetTypeFromCLSID(Guid);

[JScript] public static function GetTypeFromCLSID(Guid) : Type;

型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、指定したクラス ID (CLSID) に関連付けられた型を取得します。

[Visual Basic] Overloads Public Shared Function GetTypeFromCLSID(Guid, Boolean) As Type

[C#] public static Type GetTypeFromCLSID(Guid, bool);

[C++] public: static Type* GetTypeFromCLSID(Guid, bool);

[JScript] public static function GetTypeFromCLSID(Guid, Boolean) : Type;

指定したサーバーから、指定したクラス ID (CLSID) に関連付けられている型を取得します。

[Visual Basic] Overloads Public Shared Function GetTypeFromCLSID(Guid, String) As Type

[C#] public static Type GetTypeFromCLSID(Guid, string);

[C++] public: static Type* GetTypeFromCLSID(Guid, String*);

[JScript] public static function GetTypeFromCLSID(Guid, String) : Type;

型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、指定したサーバーの指定したクラス ID (CLSID) に関連付けられた型を取得します。

[Visual Basic] Overloads Public Shared Function GetTypeFromCLSID(Guid, String, Boolean) As Type

[C#] public static Type GetTypeFromCLSID(Guid, string, bool);

[C++] public: static Type* GetTypeFromCLSID(Guid, String*, bool);

[JScript] public static function GetTypeFromCLSID(Guid, String, Boolean) : Type;

使用例

[Visual Basic, C#, C++] 型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、ローカル ホストの CLSID に対応する型を取得する例を次に示します。

[Visual Basic, C#, C++] メモ   ここでは、GetTypeFromCLSID のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。

 
' Create a GUID.
Dim myGuid3 As New Guid("8D8529D3-625D-4496-8354-3DAD630ECC1B")
' Get the type associated with the CLSID
' from the local host and specify whether to throw an exception if an 
' error occurs while loading the type.
Dim myType3 As Type = Type.GetTypeFromCLSID(myGuid3, ".", True)
Console.WriteLine("The GUID associated with myType3 is {0}.", myType3.GUID.ToString())
Console.WriteLine("The type of the GUID is {0}.", myType3.ToString())

[C#] 
// Create a GUID.
Guid myGuid3 = new Guid("8D8529D3-625D-4496-8354-3DAD630ECC1B");
// Get the type associated with the CLSID
// from the local host and specify whether to throw an exception if an 
// error occurs while loading the type.
Type myType3 =Type.GetTypeFromCLSID(myGuid3, ".", true);
Console.WriteLine("The GUID associated with myType3 is {0}.", myType3.GUID);
Console.WriteLine("The type of the GUID is {0}.", myType3.ToString()); 

[C++] 
// Create a GUID.
Guid myGuid3 = Guid(S"8D8529D3-625D-4496-8354-3DAD630ECC1B");
// Get the type associated with the CLSID
// from the local host and specify whether to throw an exception if an
// error occurs while loading the type.
Type* myType3 = Type::GetTypeFromCLSID(myGuid3, S".", true);
Console::WriteLine(S"The GUID associated with myType3 is {0}.",__box( myType3->GUID));
Console::WriteLine(S"The type of the GUID is {0}.", myType3);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

参照

Type クラス | Type メンバ | System 名前空間