NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Type.GetTypeFromProgID (String, Boolean)

Gets the Type associated with the specified program identifier (progID), specifying whether to throw an exception on error while loading the Type.

[Visual Basic]
Overloads Public Shared Function GetTypeFromProgID( _
   ByVal progID As String, _
   ByVal throwOnError As Boolean _
) As Type
[C#]
public static Type GetTypeFromProgID(
   string progID,
   bool throwOnError
);
[C++]
public: static Type* GetTypeFromProgID(
   String* progID,
   bool throwOnError
);
[JScript]
public static function GetTypeFromProgID(
   progID : String,
   throwOnError : Boolean
) : Type;

Parameters

progID
The progID of the Type to get.
throwOnError
true to throw a TypeLoadException on error while loading the Type.

-or-

false to ignore errors while loading the Type.

Return Value

The Type associated with the specified program identifier (progID), if progID is a valid entry in the registry and a type is associated with it; otherwise, a null reference (in Visual Basic Nothing).

Exceptions

Exception Type Condition
SecurityException The requested Type is non-public and the caller does not have ReflectionPermission to reflect non-public objects outside the current assembly.
TargetInvocationException A class initializer is invoked and throws an exception.

Remarks

This method is provided for COM classic support. Program IDs are not used in the NGWS runtime because they have been superceded by the concept of namespace.

See Also

Type Class | Type Members | System Namespace | Type.GetTypeFromProgID Overload List | GetType