ClrCreateManagedInstance Function

Creates an instance of the specified managed type.

This function has been deprecated in the .NET Framework version 4. Use COM activation to create an instance of the managed type, or use hosting (see .NET Framework 4 Hosting Interfaces).

STDAPI ClrCreateManagedInstance (
    [in]  LPCWSTR  pTypeName, 
    [in]  REFIID   riid, 
    [out] void     **ppObject
);

Parameters

  • pTypeName
    [in] A pointer to the name of the instance type being requested.

  • riid
    [in] The IID of the instance type being requested.

  • ppObject
    [out] A pointer to a pointer to an instance of the managed type that was requested by the caller.

Remarks

The common language runtime should already be loaded into a process. For example, it can be loaded by using a call to the CorBindToRuntimeEx function before the ClrCreateManagedInstance function is called. If the runtime is not loaded, ClrCreateManagedInstance first tries to load v1.0.3705 of the runtime. If that fails, it attempts to load the latest version of the runtime.

Requirements

Platforms: See .NET Framework System Requirements.

Header: MSCorEE.h

Library: MSCorEE.dll

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

See Also

Other Resources

.NET Framework 1.1 and 2.0 Hosting Global Static Functions

Hosting (Unmanaged API Reference)