C# Type GetTypeFromCLSID(Guid, String)
Description
Type GetTypeFromCLSID(Guid, String)
gets the type associated
with the specified class identifier (CLSID) from the specified server.
Syntax
Type.GetTypeFromCLSID(Guid, String)
has the following syntax.
public static Type GetTypeFromCLSID(
Guid clsid,
string server
)
Parameters
Type.GetTypeFromCLSID(Guid, String)
has the following parameters.
clsid
- The CLSID of the type to get.server
- The server from which to load the type. If the server name is null, this method automatically reverts to the local machine.
Returns
Type.GetTypeFromCLSID(Guid, String)
method returns System.__ComObject regardless of whether the CLSID is valid.
Example
The following example retrieves the type associated with the CLSID from the local host.
using System;/*www .j a va 2s . co m*/
public class MainClass{
public static void Main(String[] argv){
Guid myGuid2 = new Guid("00020812-0000-0000-c000-000000000042");
Type myType2 = Type.GetTypeFromCLSID(myGuid2, ".");
Console.WriteLine(myType2.GUID);
Console.WriteLine(myType2.ToString());
}
}
The code above generates the following result.