Returns an instance of the custom implementation for the provided type or contract name.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim serviceType As Type
Dim key As String
Dim requiredCreationPolicy As CreationPolicy
Dim value As Object
value = Composition.GetInstance(serviceType, key, requiredCreationPolicy) |
Parameters
- serviceType
- The type of the requested instance.
- key
- The contract name of the instance requested. If no contract name is specified, the type will be used.
- requiredCreationPolicy
- Optionally specify whether the returned instance should be a shared, non-shared or any instance.
Return Value
The requested instance.
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also