Click or drag to resize

OnFinalConstruct Method

Called during instantiation of a driver.

virtual HRESULT OnFinalConstruct();
File

Co<MainClass>.cpp

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

The OnFinalConstruct method can be used to perform any driver-specific initialization just after object construction. The OnFinalConstruct method executes only once on the main driver classover the lifetime of the driver, irrespective of the number of times a client application calls IIviDriver::Initialize and IIviDriver::Close.

Since OnFinalConstruct executes before IIviDriver::Initialize, this function can be used to initialize data for driver methods that can themselves execute before the client calls IIviDriver::Initialize. In practice, this situation is quite rare, since most driver methods require Initialize to be called. For this reason, OnFinalConstruct is not often used in IVI-COM drivers. Rather, the ResetObjectState method, which is called with each invocation of Initialize, is used. See the description of ResetObjectState for more information.

Note Note

When this function executes, the instrument I/O infrastructure has not yet been initialized. Thus, none of the instrument I/O functions can be used within this function.

See Also

Download a complete CHM version of this documentation here.