Click or drag to resize

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);
Parameters
ResourceName

[in] String identifier specifying how to connect to the device. Usually a VISA resource descriptor.

IdQuery

[in] Indicates whether the driver should perform an ID query check during initialization.

Reset

[in] Specifies whether the driver should execute the Reset function during initialization.

OptionString

[in] Option string specifying various IVI-defined and driver-specific initialization options.

File

Co<MainClass>.cpp

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

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);

Caution note Caution

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.

See Also

Download a complete CHM version of this documentation here.