Click or drag to resize

GetRangeCheck

Indicates if range checking is enabled.

virtual bool GetRangeCheck() const abstract;
Return Value

Returns true if range checking is enabled, otherwise false.

Example

The following example demonstrates use of the GetRangeCheck function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::Configure(double Frequency, double Gain)
{
  HRESULT hr = S_OK;

  // Perform range checking before communicating with instrument
  if (GetRangeCheck())
  {
    if (Frequency < 1.0E3 || Frequency > 1.0E12)
      return err.InvalidValue(_T("Frequency"), Frequency);

    if (Gain < 0)
      return err.InvalidValue(_T("Gain"), Gain);
  }

  hr = InstrPrintCommand();

  return hr;
}
See Also

Download a complete CHM version of this documentation here.