IWMSDiagnosticEvent::get_Type
Previous | Next |
IWMSDiagnosticEvent::get_Type
The get_Type method retrieves an enumeration value indicating the type of the event notice.
Syntax
HRESULT get_Type( WMS_DIAGNOSTIC_EVENT* pVal );
Parameters
pVal
[out] Pointer to a WMS_DIAGNOSTIC_EVENT enumeration type indicating the type of the event. This must be one of the following values.
Value | Description |
WMS_DIAGNOSTIC_EVENT_LIMIT_HIT | The event is a limit hit event. |
WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_ERROR | The event was raised because a plug-in wrote a WMS_EVENT_LOG_LEVEL_ERROR to the Windows event log. The server automatically disables the plug-in when this type of event is logged. |
WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_WARNING | The event was raised because a plug-in wrote a WMS_EVENT_LOG_LEVEL_WARNING to the Windows event log. |
WMS_DIAGNOSTIC_EVENT_SERVER_EVENT_LOG_ERROR | The event was raised because the server wrote a WMS_EVENT_LOG_LEVEL_ERROR to the Windows event log. |
WMS_DIAGNOSTIC_EVENT_SERVER_EVENT_LOG_WARNING | The event was raised because the server wrote a WMS_EVENT_LOG_LEVEL_WARNING to the Windows event log. |
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Number | Description |
E_POINTER | 0x80004003 | pVal is a NULL pointer argument. |
Example Code
#include <windows.h> #include <atlbase.h> // Includes CComVariant. #include "wmsserver.h" // Declare variables and interfaces. IWMSServer *pServer; IWMSDiagnosticEvents *pDiagnosticEvents; IWMSDiagnosticEvent *pDiagnosticEvent; HRESULT hr; CComVariant varIndex; long lCount; // Initialize the COM library and retrieve a pointer // to an IWMSServer interface. hr = CoInitialize(NULL); hr = CoCreateInstance(CLSID_WMSServer, NULL, CLSCTX_ALL, IID_IWMSServer, (void **)&pServer); if (FAILED(hr)) goto EXIT; // Retrieve a pointer to the IWMSDiagnosticEvents // interface and retrieve the total count of events. hr = pServer->get_DiagnosticEvents(&pDiagnosticEvents); if (FAILED(hr)) goto EXIT; hr = pDiagnosticEvents->get_Count(&lCount); if (FAILED(hr)) goto EXIT; // Retrieve information about each diagnostic event. for (long x = 0; x < lCount; x++) { varIndex = x; hr = pDiagnosticEvents->get_Item(varIndex, &pDiagnosticEvent); if (FAILED(hr)) goto EXIT; // Retrieve the type of event. WMS_DIAGNOSTIC_EVENT deType; hr = pDiagnosticEvent->get_Type(&deType); if (FAILED(hr)) goto EXIT; if (deType == WMS_DIAGNOSTIC_EVENT_LIMIT_HIT) // TODO: Handle limit hit events. if (deType == WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_ERROR) // TODO: Handle event log errors. if (deType == WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_WARNING) // TODO: Handle event log warnings. // Release temporary COM objects. pDiagnosticEvent->Release(); } EXIT: // TODO: Release temporary COM objects and uninitialize COM.
Requirements
Header: wmsserver.h.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
Previous | Next |