共用方式為


編譯器警告 (層級 1) C4581

更新:2007 年 11 月

錯誤訊息

被取代的行為: '"string1"' 已被 'string2' 取代以處理屬性

對 Visual C++ 2005 的編譯器完成一致性處理後可能會發生這個錯誤:Visual C++ 屬性的參數檢查。

在舊版中,不管屬性值是否用引號括住都接受。如果值是列舉型別,絕對不能用引號括住。

如需詳細資訊,請參閱Visual C++ 2005 編譯器的重大變更

範例

下列範例會產生 C4581。

// C4581.cpp
// compile with: /c /W1
#include "unknwn.h"
[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface IMyI : IUnknown {};

[coclass, uuid(12345678-1111-2222-3333-123456789012), threading("free")]   // C4581
// try the following line instead
// [coclass, uuid(12345678-1111-2222-3333-123456789012), threading(free)]
class CSample : public IMyI {};