Share via


IWMSLoggingAdmin.Flush (C#)

banner art

Previous Next

IWMSLoggingAdmin.Flush (C#)

The Flush method causes all data currently in the buffer to be flushed to the log file.

Syntax

  IWMSLoggingAdmin
  .Flush();

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x80004005 The server cannot find the WMS Client Logging plug-in.

Remarks

The Flush method is only effective when buffering is in use.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSLoggingAdmin LogAdmin;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the plug-in to be configured.
    Plugin = Server.EventHandlers[
                        "WMS Client Logging"];

    // Retrieve the custom interface of the plug-in.
    LogAdmin =
        (IWMSLoggingAdmin)Plugin.CustomInterface;

    // Flush all unwritten data to the log file immediately.
    LogAdmin.Flush();
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
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 family, Windows Server 2008 family.

See Also

Previous Next