ErrorWrapper Class

Wraps objects the marshaler should marshal as a VT_ERROR.

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)

public sealed class ErrorWrapper
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class ErrorWrapper
public final class ErrorWrapper

By default, Object type arguments are marshaled as a VARIANT type, where the object type determines the VARTYPE value of the VARIANT. For example, an integer type passed as Object is marshaled as a VT_I4. In order to marshal the integer as a variant of type VT_ERROR, the integer can be wrapped in the ErrorWrapper before making the method call.

Note that ErrorWrapper objects are not marshaled as type VT_ERROR after they are passed back from COM. Lone parameters are marshaled back from COM as type VT_I4, while arrays are marshaled back from COM as type VT_UI4.

For more information on VT_ERROR, please see the existing documentation for VARENUM::VT_ERROR in the MSDN library.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0