C++/CLI では、offsetof マクロが機能しないようです。
これは、アンマネージ C++ では問題なく動作しますが、CLI では「エラー C2275: 'エンティティ' : この型を式として不正に使用しています」というエラーがスローされます。
struct Property{
char* label;
PropertyTypes type;
unsigned int member_offset;
unsigned int position;
unsigned char bit_offset;
};
struct Entity{
...
bool transparent;
...
};
Property property = {"Transparent",
TYPE_BOOL,
offsetof(Entity, transparent),
0,
0}; // C2275 HERE
CLI には代替品がありますか?