SoNetBaseGetInstanceManagedType Method (IntPtr) |
Gets a managed object for the given native handle (generic version).
Namespace: OIV.InventorAssembly: OIV.Inventor.Base (in OIV.Inventor.Base.dll) Version: 2023.1.3.0 (2023.1.3)
Syntax public static ManagedType GetInstance<ManagedType>(
IntPtr handle
)
where ManagedType : SoNetBase
Public Shared Function GetInstance(Of ManagedType As SoNetBase) (
handle As IntPtr
) As ManagedType
public:
generic<typename ManagedType>
where ManagedType : SoNetBase
static ManagedType GetInstance(
IntPtr handle
)
static member GetInstance :
handle : IntPtr -> 'ManagedType when 'ManagedType : SoNetBase
Parameters
- handle
- Type: SystemIntPtr
the native handle.
Type Parameters
- ManagedType
- the type of the managed object created.
Return Value
Type:
ManagedType
A managed wrapped object of the native object defined by the handle or
null if the handle is zero.
Exceptions Exception | Condition |
---|
ArgumentException |
Thrown when the does not represent a closed constructed type (i.e.
the managed type is a generic type definition, it does not represent
a fully qualified type).
- or -
When the ManagedType represents an abstract type.
|
Remarks
Gets a managed object for the given native handle (generic version).
Note that this method does not check if the native type
of the object (defined by the handle)
is compliant with the managed type given by the
ManagedType. You must be sure
that the handle can be wrapped as
a ManagedType.
See Also