Click or drag to resize

GetInstanceIndex

Gets the zero-based index of the repeated capability instance.

int GetInstanceIndex() const;
Return Value

Returns the zero-based index of the repeated capability instance.

Example

The following example demonstrates use of the GetInstanceIndex function.

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

  // Format the command using the repeated capability index
  // GetInstanceIndex() is 0-based, the SCPI command is 1-based
  hr = io.Printf(_T("CH%d:OFFS %.15g"), GetInstanceIndex() + 1, dOffset);

  return hr;
}
See Also

Download a complete CHM version of this documentation here.