CSystemClock Class

CSystemClock class hierarchy

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.

Implemented IPersist Methods

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.

CSystemClock::CreateInstance

CSystemClock Class

Creates a new instance when placed in the factory template table.

Syntax

static CUnknown * WINAPI CreateInstance(
    LPUNKNOWN pUnk,
    HRESULT *phr
);

Parameters

pUnk
Pointer to the controlling IUnknown interface.
phr
Pointer to an HRESULT value in which to return resulting information.

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.

CSystemClock::CSystemClock

CSystemClock Class

Constructs a CSystemClock object.

Syntax

CSystemClock(
    TCHAR *pName,
    LPUNKNOWN pUnk,
    HRESULT *phr
);

Parameters

pName
Pointer to the name of this object (used for debugging only).
pUnk
Pointer to the controlling IUnknown interface.
phr
Pointer to the HRESULT value that will be set if an error occurs.

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.

CSystemClock::GetClassID

CSystemClock Class

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.

CSystemClock::NonDelegatingQueryInterface

CSystemClock Class

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 Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.