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
属性

注解

类控制在将被包装的对象作为VARIANT传递时如何对其进行封送处理。 BStrWrapperThe BStrWrapper class controls how the wrapped object is marshaled when passed as VARIANT. 可以String VT_BSTR在对象中包装对象, 以将其封送为。 BStrWrapperYou 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) 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

获取将作为 VT_BSTR 类型进行封送的包装的 String 对象。Gets 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)

适用于