Creates an instance of the COM object whose name is specified, using the named assembly file and the constructor that best matches the specified parameters.
A handle that must be unwrapped to access the newly created instance.
Use the System.Runtime.Remoting.ObjectHandle.Unwrap method to unwrap the return value.
A System.Runtime.InteropServices.ComVisibleAttribute attribute with a value of true must be applied either explicitly or by default to the COM type so the Activator.CreateComInstanceFrom(string, string) method can create an instance of that type; otherwise, TypeLoadException is thrown.
For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the System.Reflection.Assembly.LoadFrom(string) and Activator.CreateInstance(Type, System.Reflection.BindingFlags, System.Reflection.Binder, Object[], System.Globalization.CultureInfo) methods.
Starting with the net_v20sp1_long, this method can be used to create nonpublic types if the caller has been granted System.Security.Permissions.ReflectionPermission with the System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller’s grant set or to a subset thereof. (See Security Considerations for Reflection.)
To use this functionality, your application should target the net_v35_long or later.