[in] Attribute ID of the session attribute to set.
SetAttribute
Sets an attribute on the VISA I/O session.
Syntax
Section titled “Syntax”virtual HRESULT SetAttribute(long lAttribute, UINT32 value) abstract;
virtual HRESULT SetAttribute(long lAttribute, UINT64 value) abstract;
virtual HRESULT SetAttribute(long lAttribute, bool value) abstract;
virtual HRESULT SetAttribute(long lAttribute, const CString& value) abstract;Parameters
Section titled “Parameters”lAttribute
value
[in] Value to which the attribute will be set.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”The SetAttribute function can be used to exercise very low-level control over 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
Section titled “Example”The following example demonstrates use of the SetAttribute function.
STDMETHODIMP Acme4321::IAcme4321_OnFinalInitialize(){ HRESULT hr = S_OK;
hr = io.SetAttribute(VI_ATTR_SEND_END_EN, true);
return hr;}