Share via


IWMSClassObject.AllocIWMSPacket (C#)

banner art

Previous Next

IWMSClassObject.AllocIWMSPacket (C#)

The AllocIWMSPacket method allocates an IWMSPacket object.

Syntax

  

Parameters

riid

Reference to a Guid specifying the data structure IID. This must be IID_IWMSPacket.

ppunk

Reference to an IntPtr containing a newly created IWMSPacket object.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x80070057 ppunk is null.
0x8007000E There is insufficient memory to complete the function.

Example Code

Guid PacketGuid = typeof(IWMSPacket).GUID;
IWMSPacket  Packet;
IntPtr      pUnknown;
            
try
{
    m_ClassFactory.AllocIWMSPacket(ref PacketGuid, out pUnknown);
    Packet = (IWMSPacket)Marshal.GetTypedObjectForIUnknown(pUnknown,
                                                      typeof(IWMSPacket));
}
catch( Exception e )
{
    // TODO: Handle exceptions.
}

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

Previous Next