IWMSServer::get_Status
.gif)
| Previous | Next |
IWMSServer::get_Status
The get_Status method retrieves an enumeration value indicating the current state of the server.
Syntax
HRESULT get_Status( WMS_SERVER_STATUS* pVal );
Parameters
pVal
[out] Pointer to a WMS_SERVER_STATUS enumeration value representing the current state of the server. This must be one of the following values.
| Value | Description |
| WMS_SERVER_RUNNING | Indicates that the server is running. |
| WMS_SERVER_ERROR | Indicates that a non-critical error has occurred. |
| WMS_SERVER_ERROR_CRITICAL | Indicates that a critical error has occurred. |
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 | Indicates that pVal is a NULL pointer argument. |
Example Code
#include <windows.h>
#include "wmsserver.h"
// Declare variables and interfaces.
IWMSServer *pServer;
HRESULT hr;
// 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 the status of the server.
WMS_SERVER_STATUS ssStatus;
hr = pServer->get_Status(&ssStatus);
if (FAILED(hr)) goto EXIT;
if (ssStatus == WMS_SERVER_RUNNING)
// TODO: Handle server running status.
else if (ssStatus == WMS_SERVER_ERROR)
// TODO: Handle server error status.
else if (ssStatus == WMS_SERVER_ERROR_CRITICAL)
// TODO: Handle server critical error status.
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 |