Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Runtime.​InteropServices.​ComWrappers
Assembly: System.Runtime.InteropServices
Inheritance: object → ComWrappers
Class for managing wrappers of COM IUnknown types.
Methods
public
nint
GetOrCreateComInterfaceForObject​(object instance,
CreateComInterfaceFlags flags)
instance
The managed object to expose outside the .NET runtime.
flags
Flags used to configure the generated interface.
Returns The generated COM interface, as a pointer to the <code>IUnknown</code> interface implementation, that can be passed outside the .NET runtime.
Creates a COM representation of the supplied object that can be passed to a non-managed environment.
protected
ComInterfaceEntry*
ComputeVtables​(object obj,
CreateComInterfaceFlags flags,
Int32& count)
public
object
GetOrCreateObjectForComInstance​(nint externalComObject,
CreateObjectFlags flags)
externalComObject
Object to import for usage into the .NET runtime.
flags
Flags used to describe the external object.
Returns A managed object associated with the supplied external COM object.
Gets the currently registered managed object or creates a new managed object and registers it.
public
object
GetOrCreateObjectForComInstance​(nint externalComObject,
CreateObjectFlags flags,
object userState)
externalComObject
The object to import for usage into the .NET runtime.
flags
A bitwise combination of the enumeration values that describes the external object.
userState
A state object to use to help create the wrapping .NET object.
Returns Returns a managed object associated with the supplied external COM object.
Gets the currently registered managed object or creates a new managed object and registers it.
protected
object
CreateObject​(nint externalComObject,
CreateObjectFlags flags)
externalComObject
Object to import for usage into the .NET runtime.
flags
Flags used to describe the external object.
Returns A managed object associated with the supplied external COM object.
Creates a managed object for the object that <paramref name="externalComObject" /> points to, respecting the values of <paramref name="flags" /> .
protected
object
CreateObject​(nint externalComObject,
CreateObjectFlags flags,
object userState,
CreatedWrapperFlags& wrapperFlags)
public
object
GetOrRegisterObjectForComInstance​(nint externalComObject,
CreateObjectFlags flags,
object wrapper)
externalComObject
Object to import for usage into the .NET runtime.
flags
Flags used to describe the external object.
wrapper
The object to use as the wrapper for the external object.
Returns A managed object associated with the supplied external COM object.
Gets the currently registered managed object or uses the supplied managed object and registers it.
public
object
GetOrRegisterObjectForComInstance​(nint externalComObject,
CreateObjectFlags flags,
object wrapper,
nint inner)
externalComObject
Object to import for usage into the .NET runtime.
flags
Flags used to describe the external object.
wrapper
The <see cref="T:System.Object" /> to be used as the wrapper for the external object
inner
Inner for COM aggregation scenarios
Returns Returns a managed object associated with the supplied external COM object.
Get the currently registered managed object or uses the supplied managed object and registers it.
protected
void
ReleaseObjects​(Collections.IEnumerable objects)
objects
Collection of objects to release.
Releases a collection of objects outside of the normal object or COM interface lifetime.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object