BStrWrapper Class
TOC
Collapse the table of content
Expand the table of content

BStrWrapper Class

 

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

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

System.Object
  System.Runtime.InteropServices.BStrWrapper

[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class BStrWrapper

NameDescription
System_CAPS_pubmethodBStrWrapper(Object)

Initializes a new instance of the BStrWrapper class with the specified Object object.

System_CAPS_pubmethodBStrWrapper(String)

Initializes a new instance of the BStrWrapper class with the specified String object.

NameDescription
System_CAPS_pubpropertyWrappedObject

Gets the wrapped String object to marshal as type VT_BSTR.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1

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

Return to top
Show:
© 2016 Microsoft