共用方式為


CWindow::GetDlgControl

Call this function to get a pointer to an interface of an ActiveX control that is hosted by a composite control or a control-hosting dialog.

HRESULT GetDlgControl(
   int nID,
   REFIID iid,
   void** ppCtrl 
) throw();

Parameters

  • nID
    [in] The resource ID of the control being retrieved.

  • iid
    [in] The ID of the interface you would like to get from the control.

  • ppCtrl
    [out] The pointer to the interface.

Return Value

Returns S_OK on success or any valid error HRESULT. For example, the function returns E_FAIL if the control specified by nID cannot be found and it returns E_NOINTERFACE if the control can be found, but it doesn't support the interface specified by iid.

Remarks

Using this pointer, you can call methods on the interface.

Requirements

Header: atlwin.h

See Also

Reference

CWindow Class

Other Resources

CWindow Members