BStrWrapper 类

定义

警告

此 API 现已过时。

VT_BSTR 类型的数据从托管代码封送到非托管代码。Marshals data of type VT_BSTR from managed to unmanaged code. 无法继承此类。This class cannot be inherited.

public ref class BStrWrapper sealed
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
[System.Obsolete("BStrWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")]
public sealed class BStrWrapper
type BStrWrapper = class
Public NotInheritable Class BStrWrapper
继承
BStrWrapper
属性

注解

BStrWrapper 类控制在将包装的对象作为 VARIANT传递时如何对其进行封送处理。The BStrWrapper class controls how the wrapped object is marshaled when passed as VARIANT. 可以将 String 对象包装在 BStrWrapper 对象中,以便将其封送为 VT_BSTRYou can wrap a String object in a BStrWrapper object to marshal it as VT_BSTR. 将空字符串传递给非托管代码时,BStrWrapper 非常有用。BStrWrapper is useful when passing a null string to unmanaged code. 如果没有 BStrWrapper,则将空字符串作为 VT_EMPTY传递;但是,将字符串与 BStrWrapper 包装将确保将 null 字符串作为 VT_BSTR传递。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.

构造函数

BStrWrapper(Object)

使用指定的 BStrWrapper 对象初始化 Object 类的新实例。Initializes a new instance of the BStrWrapper class with the specified Object object.

BStrWrapper(String)

使用指定的 BStrWrapper 对象初始化 String 类的新实例。Initializes a new instance of the BStrWrapper class with the specified String object.

属性

WrappedObject

获取将作为 String 类型进行封送的包装的 VT_BSTR 对象。Gets the wrapped String object to marshal as type VT_BSTR.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于