Freigeben über


AtlAdviseSinkMap

Call this function to advise or unadvise all entries in the object's sink event map.

HRESULT AtlAdviseSinkMap(
   T* pT,
   bool bAdvise 
);

Parameters

  • pT
    [in] A pointer to the object containing the sink map.

  • bAdvise
    [in] true if all sink entries are to be advised; false if all sink entries are to be unadvised.

Return Value

A standard HRESULT value.

Example

class CMyDlg : 
   public CAxDialogImpl<CMyDlg>
{
public:
BEGIN_MSG_MAP(CMyDlg)
   MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
   COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK)
   COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnClickedCancel)
   CHAIN_MSG_MAP(CAxDialogImpl<CMyDlg>)
END_MSG_MAP()

   LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
   {
      CAxDialogImpl<CMyDlg>::OnInitDialog(uMsg, wParam, lParam, bHandled);

      AtlAdviseSinkMap(this, TRUE);

      bHandled = TRUE;
      return 1;  // Let the system set the focus
   }

   // Remainder of class declaration omitted.

Requirements

Header: atlcom.h

See Also

Other Resources

Connection Point Global Functions