Click or drag to resize

GetAttribute

Gets the value of an attribute on the VISA I/O session.

virtual HRESULT GetAttribute(long lAttribute, UINT32* pValue) abstract;

virtual HRESULT GetAttribute(long lAttribute, UINT64* pValue) abstract;

virtual HRESULT GetAttribute(long lAttribute, bool* pValue) abstract;

virtual HRESULT GetAttribute(long lAttribute, CString& pValue) abstract;
Parameters
lAttribute

[in] Attribute ID of the session attribute to set.

pValue

[out] Value of the specified attribute.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

The GetAttribute function can be used to retrieve very low-level information about the VISA I/O session. The allowed values for the lAttribute correspond to the VISA attribute ID values available in the VISA specification. These values may also be found in the visa.h header file. See the VISA specification for details.

Example

The following example demonstrates use of the GetAttribute function.

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

  CString strManufacturer;
  hr = io.GetAttribute(VI_ATTR_MANF_NAME, strManufacturer);

  return hr;
}
See Also

Other Resources

Download a complete CHM version of this documentation here.