IUnknown::QueryInterface

Send Feedback

The QueryInterface method returns a pointer to a specified interface on an object to which a client currently holds an interface pointer. This method must call the IUnknown::AddRef method on the pointer it returns.

Note   The QueryInterface method is not implemented on many Windows Mobile-based MAPI interfaces for Pocket PC and Smartphone 2002 or Windows Mobile 2003.

Syntax

HRESULT QueryInterface(
  REFIID iid,
  void ** ppvObject
);

Parameters

  • iid
    [in] Identifier of the interface being requested.
  • ppvObject
    [out] Address of the pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObject contains the requested interface pointer to the object. If the object does not support the interface specified in iid, *ppvObject is set to NULL.

Return Values

  • S_OK
    Indicates that the interface specified by iid is supported, and the method returned successfully.
  • E_NOINTERFACE
    Indicates that the interface specified by iid is not supported.
  • E_NOTIMPL
    Indicates that QueryInterface is not implemented on the interface object from which it is being called.

Remarks

For more information about this method, see IUnknown::QueryInterface in the Window CE documentation.

Requirements

Pocket PC: Pocket PC 2002 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: unknwn.h

See Also

IUnknown | Messaging

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.