C++/CLIではoffsetofマクロが機能していないようです。C++/CLIを使用したマクロのオフセット
アンマネージドC++では正常に動作しますが、「エラーC2275: 'エンティティ':この型の不正な式としての使用」がCLIで発生します。
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にはいくつかの代替品がありますか?
いくつかのコードをしてください。 – dirkgently