編譯器錯誤 C3372
在 coclass上必須對屬性 'source' 至少指定一個介面
對於特定屬性,您必須將介面名稱傳遞為參數。
下列範例會產生 C3372:
// C3372.cpp
#include <windows.h>
[module(name="MyModule")];
[ object, uuid(373a1a4c-469b-11d3-a6b0-00c04f79ae8f) ]
__interface IMyIface {
HRESULT f1();
};
// to resolve, pass an interface name to the source attribute
// for example, source(IMyIface)
[ coclass, uuid(373a1a4d-469b-11d3-a6b0-00c04f79ae8f), source,
default(IMyIface) ] // C3372
class CMyClass {
};
int main() {
}