![]() | Initialize Method |
Called be client applications to initialize the driver and establish an I/O connection to the device.
HRESULT Initialize(BSTR ResourceName, VARIANT_BOOL IdQuery, VARIANT_BOOL Reset, VARIANT_BOOL OptionString);
[in] String identifier specifying how to connect to the device. Usually a VISA resource descriptor.
[in] Indicates whether the driver should perform an ID query check during initialization.
[in] Specifies whether the driver should execute the Reset function during initialization.
[in] Option string specifying various IVI-defined and driver-specific initialization options.
Co<MainClass>.cpp
Returns S_OK if successful, otherwise a failure HRESULT.
The IIviDriver::Initialize method executes in response to each client program call to Initialize. The default implementation simply delegates to an internal Nimbus implementation that performs a wide variety of tasks. It is critical that any customization of the Initialize function ultimately call the internal Nimbus implementation using the following syntax:
hr = DriverBase::Initialize(ResourceName, IdQuery, Reset, OptionString);
![]() |
---|
If you customize the implementation of IIviDriver::Initialize and do not call the internal Nimbus implementation, the driver will almost certainly not operate correctly. Nimbus relies heavily upon the code inside this internal implementation. |
The most common reason to customize the implementation of Initialize is to perform pre-processing or post-processing of the Nimbus implementation. Post-processing is arguably more useful since the driver is not in a fully initialized state before the call to the internal Nimbus implementation.