Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3743

can only hook/unhook an entire interface when the 'layout_dependent' parameter of event_receiver is true

The __unhook function varies in the number of parameters that it takes based on the value passed to the layout_dependent parameter in the event_receiver class.

The following sample generates C3743:

// C3743.cpp
#include <atlbase.h>
#include <atlcom.h>
[object] __interface I { HRESULT f(); };

[event_receiver(com, layout_dependent=true), coclass]
struct R : I {
        HRESULT f() {
      return 0;
        R() {

   R(I* a) {
      __hook(I, a, &R::f);   // C3743
      // The following line resolves the error.
      // __hook(I, a);

Community Additions

© 2015 Microsoft