Click or drag to resize

SetTerminationCharacterEnabled

Enables for disables the I/O termination character for read operations.

virtual HRESULT SetTerminationCharacterEnabled(bool bEnabled) abstract;
Parameters
bEnabled

[in] When true, the termination character is used to determine when a read operation ends.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

When the termination character is enabled using this function, the termination character specified with the SetTerminationCharacter function determines when the read operation terminates.

The default termination character is set to the newline character (\n) and it is enabled by default.

Example

The following example demonstrates use of the SetTerminationCharacterEnabled function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::OnFinalInitialize()
{
  HRESULT hr = S_OK;

  // Set the termination character to a carriage-return (\r) and enable it
  hr = io.SetTerminationCharacter('\r');
  if (SUCCEEDED(hr))
  {
    hr = io.SetTerminationCharacterEnabled(true);
  }

  return hr;
}
See Also

Download a complete CHM version of this documentation here.