नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'class' : coclass does not specify a default interface that is an event source
Remarks
A source interface was not specified for a class.
Example
The following example generates C4681:
// C4681.cpp
// compile with: /W4 /c
#define _ATL_ATTRIBUTES 1
#include <atlbase.h>
#include <atlcom.h>
[module(name="test")];
[dual, uuid("00000000-0000-0000-0000-000000000000")]
__interface IEvent { [id(3)] HRESULT myEvent(); };
[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface ISource { HRESULT Fire(); };
[ coclass,
source(IEvent),
default(ISource),
// Uncomment the following line to resolve.
// default(IEvent),
uuid("00000000-0000-0000-0000-000000000002")
]
struct CSource : ISource { // C4681
HRESULT Fire() { return 0; }
};