CComControl::ControlQueryInterface

Retrieves a pointer to the requested interface.

virtual HRESULT ControlQueryInterface( 
   const IID& iid,
   void** ppv  
);

Parameters

  • iid
    [in] The GUID of the interface being requested.

  • ppv
    [out] A pointer to the interface pointer identified by iid, or NULL if the interface is not found.

Remarks

Only handles interfaces in the COM map table.

Example

// Retrieve the control's IOleObject interface. Note interface  
// is automatically released when pOleObject goes out of scope

CComPtr<IOleObject> pOleObject;
ControlQueryInterface(IID_IOleObject, (void**)&pOleObject);

Requirements

Header: atlctl.h

See Also

Reference

CComControl Class

CComObjectRootEx::InternalQueryInterface