ClearBox Server™ v1.2 Developer's Guide


Allows server extension to log its errors in server errors logfile.

This method can be used when more than one error occur during server extension execution, and simply returning error code from erroneous method is not enough.

HRESULT FailureShutdown(
	[in] HRESULT erCode,
	[in] BSTR errDescription);


[in] Error code that possibly describes the error.
[in] Error description that will be written to the log.

Return Values

This method always returns S_OK.

Thread Safety

This method can be called from any thread.

Memory Management

Server extension should allocate and free memory for errDescription parameter.


This method is useful as it may be called several times within one server extension method.

Example Code

This code uses m_pServer as IServer interface pointer stored in ICommonExtenderEx::InitializeEx implementation. In this example server extension logs its error as a string "An error has occurred".

if (/* something goes wrong */)
	IServer2* pS2=NULL;
	//QueryInterface will always succeed
	BSTR errD=SysAllocString(L"An error has occurred!");
	// Call to  pS2->Release() is not necessary 

See Also

IServer2, Server services

© 2001-2003 XPerience Technologies.

Created by chm2web html help conversion utility.