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
[C#]
object GetService(
   Type serviceType
);
[C++]
Object* GetService(
   Type* serviceType
);
[JScript]
function GetService(
   serviceType : Type
) : Object;

Parameters

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

Return Value

A service object of type serviceType.

-or-

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

Requirements

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

Show: