System.Runtime.InteropServices.BStrWrapper Class

Marshals data of type VT_BSTR from managed to unmanaged code. This class cannot be inherited.

See Also: BStrWrapper Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public sealed class BStrWrapper

Remarks

The System.Runtime.InteropServices.BStrWrapper class controls how the wrapped object is marshaled when passed as VARIANT. You can wrap a string object in a System.Runtime.InteropServices.BStrWrapper object to marshal it as VT_BSTR. System.Runtime.InteropServices.BStrWrapper is useful when passing a null string to unmanaged code. Without System.Runtime.InteropServices.BStrWrapper, a null string is passed as VT_EMPTY; however, wrapping the string with System.Runtime.InteropServices.BStrWrapper ensures that the null string is passed as VT_BSTR.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0