The CSystemClock class implements a system clock that provides time information and timing signals to an application. It uses the CBaseReferenceClock base class to provide most of that functionality, adding persistence.
CSystemClock implements the IPersist interface. For more implementation information, see "OLE Programmers Reference (Vol. 1): Structured Storage Overview."
Member Functions
CreateInstance Creates an instance of a system clock. CSystemClock Constructs a CSystemClock object.
GetClassID Retrieves the class identifier for this clock (CLSID_SystemClock).
Implemented INonDelegatingUnknown Methods
NonDelegatingQueryInterface Passes out pointers to IID_IPersist, and calls the base clock for other interface queries.
Creates a new instance when placed in the factory template table.
Syntax
static CUnknown * WINAPI CreateInstance( LPUNKNOWN pUnk, HRESULT *phr );
Parameters
Return Value
Returns a pointer to a new Component Object Model (COM) object.
Remarks
This member function is required to create objects using the class factory. It calls the class constructor.
The phr parameter will be modified only if a failure occurs. If it is a failure code on input, construction can be terminated, but in any case the destructor will be called by the creator when the HRESULT error is detected.
Constructs a CSystemClock object.
Syntax
CSystemClock( TCHAR *pName, LPUNKNOWN pUnk, HRESULT *phr );
Parameters
Return Value
No return value.
Remarks
If phr points to something other than S_OK upon entry, the object will not be constructed. If an error occurs during construction, this variable will be set; otherwise, its contents will not be altered.
Retrieves the class identifier for this clock.
Syntax
HRESULT GetClassID( CLSID *pClsID );
Parameters
- pClsID
- Pointer to a CLSID structure that is filled with CLSID_SystemClock.
Return Value
Returns an HRESULT value.
Retrieves an interface and increments the reference count.
Syntax
HRESULT NonDelegatingQueryInterface( REFIID riid, void **ppv );
Parameters
- riid
- Reference identifier.
- ppv
- Address of a pointer to the interface.
Return Value
Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or E_NOINTERFACE if it is not.
Remarks
This member function implements the INonDelegatingUnknown::NonDelegatingQueryInterface method and passes out references to the IReferenceClock, IPersist, and IUnknown interfaces.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.