Type.GetTypeFromCLSID メソッド (Guid, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim clsid As Guid Dim server As String Dim returnValue As Type returnValue = Type.GetTypeFromCLSID(clsid, server)
- clsid
取得する型の CLSID。
CLSID が有効かどうかに関係なく System.__ComObject。

ローカル ホストの 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())
// 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());
// Create a GUID. Guid myGuid2 = 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 );
// 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.get_GUID()); Console.WriteLine("The type of the GUID is {0}.", myType2.ToString());

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Type.GetTypeFromCLSID メソッド (Guid, Boolean)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim clsid As Guid Dim throwOnError As Boolean Dim returnValue As Type returnValue = Type.GetTypeFromCLSID(clsid, throwOnError)
- clsid
取得する型の CLSID。
CLSID が有効かどうかに関係なく System.__ComObject。


型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、ローカル ホストの CLSID に対応する型を取得する例を次に示します。
Imports System Class MyGetTypeFromCLSIDSample Public Shared Sub Main() Try ' Create a GUID. Dim myGuid1 As New Guid("1DCD0710-0B41-11D3-A565-00C04F8EF6E3") ' Get the type associated with the CLSID ' and specify whether to throw an exception if an error occurs ' while loading the type. Dim myType1 As Type = Type.GetTypeFromCLSID(myGuid1, True) Console.WriteLine("The GUID associated with myType1 is {0}.", myType1.GUID.ToString()) Console.WriteLine("The type of the GUID is {0}.", myType1.ToString())
using System; class MyGetTypeFromCLSIDSample { public static void Main() { try { // Create a GUID. Guid myGuid1 = new Guid("1DCD0710-0B41-11D3-A565-00C04F8EF6E3"); // Get the type associated with the CLSID // and specify whether to throw an exception if an error occurs // while loading the type. Type myType1 =Type.GetTypeFromCLSID(myGuid1, true); Console.WriteLine("The GUID associated with myType1 is {0}." , myType1.GUID); Console.WriteLine("The type of the GUID is {0}.", myType1.ToString());
using namespace System; int main() { try { // Create a GUID. Guid myGuid1 = Guid("1DCD0710-0B41-11D3-A565-00C04F8EF6E3"); // Get the type associated with the CLSID // and specify whether to throw an exception if an error occurs // while loading the type. Type^ myType1 = Type::GetTypeFromCLSID( myGuid1, true ); Console::WriteLine( "The GUID associated with myType1 is {0}.", myType1->GUID ); Console::WriteLine( "The type of the GUID is {0}.", myType1 );
import System.*; class MyGetTypeFromCLSIDSample { public static void main(String[] args) { try { // Create a GUID. Guid myGuid1 = new Guid("1DCD0710-0B41-11D3-A565-00C04F8EF6E3"); // Get the type associated with the CLSID // and specify whether to throw an exception if an error occurs // while loading the type. Type myType1 = Type.GetTypeFromCLSID(myGuid1, true); Console.WriteLine("The GUID associated with myType1 is {0}." , myType1.get_GUID()); Console.WriteLine("The type of the GUID is {0}.", myType1.ToString());

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Type.GetTypeFromCLSID メソッド (Guid)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim clsid As Guid Dim returnValue As Type returnValue = Type.GetTypeFromCLSID(clsid)
- clsid
取得する型の CLSID。
CLSID が有効かどうかに関係なく System.__ComObject。

Guid 構造体のコンストラクタに clsid パラメータを渡して GUID を取得してから、指定したクラス ID (CLSID) に対応する型を取得する例を次に示します。
Imports System Class MyGetTypeFromCLSID Public Shared Sub Main() ' Create a GUID object by passing the clsid parameter. Dim myGuid1 As New Guid("1AE77DA4-1063-4ab3-BCD2-085B001EFB97") ' Get the type associated with the CLSID. Dim myType1 As Type = Type.GetTypeFromCLSID(myGuid1) ' Display the GUID. Console.WriteLine(myType1.GUID.ToString()) ' Convert the GUID to a string. Console.WriteLine(myType1.ToString()) End Sub 'Main End Class 'MyGetTypeFromCLSID
using System; class MyGetTypeFromCLSID { public static void Main() { // Create a GUID object by passing the clsid parameter. Guid myGuid1 = new Guid("1AE77DA4-1063-4ab3-BCD2-085B001EFB97"); // Get the type object associated with the CLSID. Type myType1 = Type.GetTypeFromCLSID(myGuid1); // Display the GUID. Console.WriteLine(myType1.GUID); // Convert the GUID to a string. Console.WriteLine(myType1.ToString()); } }
using namespace System; int main() { // Create a GUID object by passing the clsid parameter. Guid myGuid1 = Guid("1AE77DA4-1063-4ab3-BCD2-085B001EFB97"); // Get the type object associated with the CLSID. Type^ myType1 = Type::GetTypeFromCLSID( myGuid1 ); // Display the GUID. Console::WriteLine( myType1->GUID ); // Convert the GUID to a String*. Console::WriteLine( myType1 ); }
import System.*; class MyGetTypeFromCLSID { public static void main(String[] args) { // Create a GUID object by passing the clsid parameter. Guid myGuid1 = new Guid("1AE77DA4-1063-4ab3-BCD2-085B001EFB97"); // Get the type object associated with the CLSID. Type myType1 = Type.GetTypeFromCLSID(myGuid1); // Display the GUID. Console.WriteLine(myType1.get_GUID()); // Convert the GUID to a string. Console.WriteLine(myType1.ToString()); } //main } //MyGetTypeFromCLSID

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Type.GetTypeFromCLSID メソッド

名前 | 説明 |
---|---|
Type.GetTypeFromCLSID (Guid) | 指定したクラス ID (CLSID) に関連付けられている型を取得します。 .NET Compact Framework によってサポートされています。 |
Type.GetTypeFromCLSID (Guid, Boolean) | 型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、指定したクラス ID (CLSID) に関連付けられた型を取得します。 .NET Compact Framework によってサポートされています。 |
Type.GetTypeFromCLSID (Guid, String) | 指定したサーバーから、指定したクラス ID (CLSID) に関連付けられている型を取得します。 |
Type.GetTypeFromCLSID (Guid, String, Boolean) | 型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、指定したサーバーの指定したクラス ID (CLSID) に関連付けられた型を取得します。 |

Type.GetTypeFromCLSID メソッド (Guid, String, Boolean)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Shared Function GetTypeFromCLSID ( _ clsid As Guid, _ server As String, _ throwOnError As Boolean _ ) As Type
Dim clsid As Guid Dim server As String Dim throwOnError As Boolean Dim returnValue As Type returnValue = Type.GetTypeFromCLSID(clsid, server, throwOnError)
public static function GetTypeFromCLSID ( clsid : Guid, server : String, throwOnError : boolean ) : Type
- clsid
取得する型の CLSID。
CLSID が有効かどうかに関係なく System.__ComObject。


型の読み込み中にエラーが発生した場合に例外をスローするかどうかを指定して、ローカル ホストの CLSID に対応する型を取得する例を次に示します。
' 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())
// 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());
// Create a GUID. Guid myGuid3 = 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 );
// 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.get_GUID()); Console.WriteLine("The type of the GUID is {0}.", myType3.ToString());

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.GetTypeFromCLSIDのページへのリンク