Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The CreateInstance method is a generic method for creating objects for the server.
void IWMSClassObject.CreateInstance(
ref Guid riid,
out IntPtr ppunk
);
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 (C#).
|
IID_IWMSDataContainerVersion
|
GUID identifying an IWMSDataContainerVersionIWMSDataContainerVersion Object (C#).
|
IID_IWMSPacket
|
GUID identifying an IWMSPacketIWMSPacket Object (C#).
|
IID_IWMSPacketList
|
GUID identifying an IWMSPacketListIWMSPacketList Object (C#).
|
IID_IWMSStreamHeader
|
GUID identifying an IWMSStreamHeaderIWMSStreamHeader Object (C#).
|
IID_IWMSStreamHeaderList
|
GUID identifying an IWMSStreamHeaderListIWMSStreamHeaderList Object (C#).
|
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
Guid ContentDescListGuid = typeof(IWMSContentDescriptionList).GUID;
IWMSContentDescriptionList ContentDescList;
IntPtr pUnknown;
try
{
m_ClassFactory.CreateInstance(ref ContentDescListGuid, out pUnknown);
ContentDescList =
(IWMSContentDescriptionList)Marshal.GetTypedObjectForIUnknown(
pUnknown, typeof(IWMSContentDescriptionList));
}
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.