This documentation is archived and is not being maintained.

IServiceProvider.GetService Method

Gets the service object of the specified type.

[Visual Basic]
Function GetService( _
   ByVal serviceType As Type _
) As Object
object GetService(
   Type serviceType
Object* GetService(
   Type* serviceType
function GetService(
   serviceType : Type
) : Object;


An object that specifies the type of service object to get.

Return Value

A service object of type serviceType.


A null reference (Nothing in Visual Basic) if there is no service object of type serviceType.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

IServiceProvider Interface | IServiceProvider Members | System Namespace