UnknownWrapper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
UnknownWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.
Wraps objects the marshaler should marshal as a VT_UNKNOWN
.
public ref class UnknownWrapper sealed
[System.Obsolete("UnknownWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")]
public sealed class UnknownWrapper
public sealed class UnknownWrapper
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class UnknownWrapper
[<System.Obsolete("UnknownWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")>]
type UnknownWrapper = class
type UnknownWrapper = class
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type UnknownWrapper = class
Public NotInheritable Class UnknownWrapper
- Inheritance
-
UnknownWrapper
- Attributes
Remarks
Only applies when the managed signature of a method takes an object.
int MyMethod(Object o); //Managed signature
HRESULT MyMethod(VARIANT o); //COM signature
MyObject o = new MyObject();
MyMethod(o); //o gets passed as VARIANT VT_DISPATCH
MyMethod(new UnknownWrapper(o)); //o gets passed as VARIANT VT_UNKNOWN
Constructors
UnknownWrapper(Object) |
Initializes a new instance of the UnknownWrapper class with the object to be wrapped. |
Properties
WrappedObject |
Gets the object contained by this wrapper. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈