Click or drag to resize

CloseIO Method

Closes the instrument I/O communication layer (often VISA or VISA-COM).

virtual HRESULT CloseIO();
File

Co<MainClass>.cpp

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

When to Override

Override this function when you want to perform additional closing at the same time as when the I/O is closed. A common case is if an external DLL library is being used for instrument I/O. You would want to close the external DLL here and release any I/O related resources.

Remarks

This function is used in the implementation of the IIviDriver::Close method.

Example
C++
// CoAcme4321.cpp
class ATL_NO_VTABLE Acme4321 : 
{
   // ...

   virtual HRESULT CloseIO()
   {
      // Call the base class implementation
      HRESULT hr = __super::CloseIO();
      if (SUCCEEDED(hr))
      {
         // TODO: additional I/O shutdown here, such as closing an external DLL
      }

      return hr;
   }

   // ...
}

Download a complete CHM version of this documentation here.