Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Know when object advise

Know when object advise

Scheduled Pinned Locked Moved COM
c++
2 Posts 1 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomer dror
    wrote on last edited by
    #1

    Hi I want to override IConnectionPointImpl advise so i can get the IUnkown of the object which hand it's sink which is the best,easy way to do it in ATL thanks tomer

    T 1 Reply Last reply
    0
    • T tomer dror

      Hi I want to override IConnectionPointImpl advise so i can get the IUnkown of the object which hand it's sink which is the best,easy way to do it in ATL thanks tomer

      T Offline
      T Offline
      tomer dror
      wrote on last edited by
      #2

      OK,I found a very simple solution... template class CAdviSeNotify: public IConnectionPointImpl { public: typedef IConnectionPointImpl baseClass; CAdviSeNotify(){}; virtual ~CAdviSeNotify(){}; STDMETHOD(Advise)(IUnknown* pUnkSink, DWORD* pdwCookie) { T* pT = static_cast(this); pT->OnClientAdvise(pUnkSink,piid); return baseClass::Advise(pUnkSink,pdwCookie); } STDMETHOD(Unadvise)(DWORD dwCookie) { T* pT = static_cast(this); return baseClass::Unadvise(dwCookie); } };

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups