BStrWrapper BStrWrapper BStrWrapper BStrWrapper Class

定义

警告

此 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
继承
BStrWrapperBStrWrapperBStrWrapperBStrWrapper
属性

注解

BStrWrapper类控制包装的对象作为传递时如何封送VARIANTThe 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 将 null 字符串传递给非托管代码时很有用。BStrWrapper is useful when passing a null string to unmanaged code. 无需BStrWrapper,作为传递空字符串VT_EMPTY; 但是,包装与字符串BStrWrapper可确保作为传递 null 字符串VT_BSTRWithout 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) BStrWrapper(Object) BStrWrapper(Object)

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

BStrWrapper(String) BStrWrapper(String) BStrWrapper(String) BStrWrapper(String)

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

属性

WrappedObject WrappedObject WrappedObject WrappedObject

获取包装String对象作为类型封送VT_BSTRGets the wrapped String object to marshal as type VT_BSTR.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于