IWMSClassObject.CreateInstance (Visual Basic .NET)

The CreateInstance method is a generic method for creating objects for the server.

IWMSClassObject.CreateInstance(  ByRef riid As Guid,
  ByRef ppunk As IntPtr
)

Arguments

Reference to a Guid specifying the requested object. This must be one of the following values.

Value

Description

IID_IWMSContentDescriptionList
GUID identifying an IWMSContentDescriptionListIWMSContentDescriptionList Object (Visual Basic .NET).
IID_IWMSDataContainerVersion
GUID identifying an IWMSDataContainerVersionIWMSDataContainerVersion Object (Visual Basic .NET).
IID_IWMSPacket
GUID identifying an IWMSPacketIWMSPacket Object (Visual Basic .NET).
IID_IWMSPacketList
GUID identifying an IWMSPacketListIWMSPacketList Object (Visual Basic .NET).
IID_IWMSStreamHeader
GUID identifying an IWMSStreamHeaderIWMSStreamHeader Object (Visual Basic .NET).
IID_IWMSStreamHeaderList
GUID identifying an IWMSStreamHeaderListIWMSStreamHeaderList Object (Visual Basic .NET).

Reference to an IntPtr containing a newly created object.

Return Value

This method does not return a value.

If this method fails, it throws an exception.

Number

Description

0x80070057

ppunk is null or riid is not equal to one of the expected values.

0x8007000E

There is insufficient memory to complete the function.

Example

Dim ContentDescList As IWMSContentDescriptionList
Dim pUnknown As IntPtr

Try
    m_ClassFactory.CreateInstance( _
                               GetType(IWMSContentDescriptionList).GUID, _
                               pUnknown)
    ContentDescList = Marshal.GetTypedObjectForIUnknown(pUnknown, _
                                      GetType(IWMSContentDescriptionList))

Catch e As Exception
    ' TODO: Handle exceptions.
End Try

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Concepts

IWMSClassObject Object (Visual Basic .NET)