Creates an object that can substitute for another data type.
Public Shared Function CreateInstance ( _ provider As IServiceProvider, _ objectType As Type, _ argTypes As Type(), _ args As Object() _ ) As Object
Dim provider As IServiceProvider Dim objectType As Type Dim argTypes As Type() Dim args As Object() Dim returnValue As Object returnValue = TypeDescriptor.CreateInstance(provider, _ objectType, argTypes, args)
public static Object CreateInstance( IServiceProvider provider, Type objectType, Type[] argTypes, Object[] args )
public: static Object^ CreateInstance( IServiceProvider^ provider, Type^ objectType, array<Type^>^ argTypes, array<Object^>^ args )
public static function CreateInstance( provider : IServiceProvider, objectType : Type, argTypes : Type[], args : Object[] ) : Object
objectType is nullNothingnullptra null reference (Nothing in Visual Basic), or args is nullNothingnullptra null reference (Nothing in Visual Basic) when argTypes is not nullNothingnullptra null reference (Nothing in Visual Basic).
argTypes and args have different number of elements.
The CreateInstance method will search for a TypeDescriptionProvider that is associated with the specified objectType data type. This method first tries to obtain a type description provider from the provider parameter. If this fails, it searches its own internal tables for a provider (these entries were created through previous calls to AddProvider). If it finds a provider, this method will delegate the creation call to that object.
If the derived class does not provide a substitute instance, this method should call the base implementation.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98