नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'class': must be a coclass when the 'layout_dependent' parameter of event_receiver = true
Remarks
When layout_dependent=true for an event_receiver class, then the class must also have the coclass attribute.
Example
The following example generates C3741
// C3741.cpp
// compile with: /c
// C3741 expected
#define _ATL_ATTRIBUTES 1
#include <atlbase.h>
#include <atlcom.h>
[module(name="xx")];
[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface I{ HRESULT f(); };
// Delete the following line to resolve.
[ event_receiver(com, layout_dependent=true)]
// class or struct must be declared with coclass
// Uncomment the following line to resolve.
// [ event_receiver(com, layout_dependent=true), coclass, uuid("00000000-0000-0000-0000-000000000002")]
struct R : I {
HRESULT f(){ return 0; }
R(){}
R(I* a){ __hook(I, a); }
};