共用方式為


編譯器警告 (層級 1) C4917

'declarator' : GUID 僅能與類別、介面或命名空間產生關聯

類別介面命名空間以外的使用者定義結構不能有 GUID。

此警告在預設情況下為關閉的。 如需詳細資訊,請參閱預設為關閉的編譯器警告

下列程式碼範例會產生 C4917:

// C4917.cpp
// compile with: /W1
#pragma warning(default : 4917)
__declspec(uuid("00000000-0000-0000-0000-000000000001")) struct S
{
} s;   // C4917, don't put uuid on a struct

int main()
{
}