Freigeben über


MAPI IUnknown::QueryInterface

4/8/2010

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 MAPI IUnknown::AddRef method on the pointer it returns.

The standard IUnknown method with Windows Mobile (versions 5.0 and later) corresponds to the standard COM IUnknown interface.

Note

The QueryInterface method is not implemented on many of the CE MAPI interfaces for Pocket PC 2002 and later, and for Smartphone 2002 and later. To determine whether the platform supports this interface, see Determining Supported COM APIs.

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 iid. 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 Value

  • 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.

Requirements

Header unknwn.h
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IUnknown for MAPI

Other Resources

Messaging
IUnknown Basics