次の方法で共有


Type.GetTypeFromCLSID メソッド (Guid, String)

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

Overloads Public Shared Function GetTypeFromCLSID( _
   ByVal clsid As Guid, _   ByVal server As String _) As Type
[C#]
public static Type GetTypeFromCLSID(Guidclsid,stringserver);
[C++]
public: static Type* GetTypeFromCLSID(Guidclsid,String* server);
[JScript]
public static function GetTypeFromCLSID(
   clsid : Guid,server : String) : Type;

パラメータ

  • clsid
    取得する型の CLSID。
  • server
    型の読み込み元のサーバー。サーバー名が null 参照 (Visual Basic では Nothing) の場合、このメソッドは自動的にローカル マシンの名前を使用します。

戻り値

CLSID が有効かどうかに関係なく System.__ComObject

使用例

[Visual Basic, C#, C++] ローカル ホストの CLSID に対応する型を取得する例を次に示します。

 
' Create a GUID.
Dim myGuid2 As New Guid("00020812-0000-0000-c000-000000000046")
' Get the type associated with the CLSID
' from the local host.
Dim myType2 As Type = Type.GetTypeFromCLSID(myGuid2, ".")
Console.WriteLine("The GUID associated with myType2 is {0}.", myType2.GUID.ToString())
Console.WriteLine("The type of the GUID is {0}.", myType2.ToString())

[C#] 
// Create a GUID.
Guid myGuid2 = new Guid("00020812-0000-0000-c000-000000000046");
// Get the type associated with the CLSID
// from the local host.
Type myType2 =Type.GetTypeFromCLSID(myGuid2, ".");
Console.WriteLine("The GUID associated with myType2 is {0}.", myType2.GUID);
Console.WriteLine("The type of the GUID is {0}.", myType2.ToString());

[C++] 
// Create a GUID.
Guid myGuid2 = Guid(S"00020812-0000-0000-c000-000000000046");
// Get the type associated with the CLSID
// from the local host.
Type* myType2 =Type::GetTypeFromCLSID(myGuid2, S".");
Console::WriteLine(S"The GUID associated with myType2 is {0}.",__box( myType2->GUID));
Console::WriteLine(S"The type of the GUID is {0}.", myType2);

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

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

Type クラス | Type メンバ | System 名前空間 | Type.GetTypeFromCLSID オーバーロードの一覧