Properties C++;(生成器XE7)枚举类型属性错误行为 我不是C++专家,但需要更新一个旧项目,以ActuCabro C++ +Builder Xe7。p>

Properties C++;(生成器XE7)枚举类型属性错误行为 我不是C++专家,但需要更新一个旧项目,以ActuCabro C++ +Builder Xe7。p>,properties,enums,c++builder,c++builder-xe7,Properties,Enums,C++builder,C++builder Xe7,此代码不编译(固定行): 及 错误:“E2451未定义符号'fpFixed'” 另外两次尝试: NewText->Font->Pitch = TFontPitch.fpFixed; NewText->Font->Pitch = System::Uitypes::TFontPitch.fpFixed; 两个错误:E2108不正确使用typedef'TFontPitch' 但奇怪的是,这种编译过程没有任何警告: System::Uitypes::TFontPitch( fp

此代码不编译(固定行):

错误:“E2451未定义符号'fpFixed'”

另外两次尝试:

NewText->Font->Pitch = TFontPitch.fpFixed;
NewText->Font->Pitch = System::Uitypes::TFontPitch.fpFixed;
两个错误:E2108不正确使用typedef'TFontPitch'

但奇怪的是,这种编译过程没有任何警告:

System::Uitypes::TFontPitch( fpFixed );   // yes,no assignments here just an unused value
NewText->Font->Pitch = fpFixed;
这是怎么解释的?我是不是做错了什么?只是经过反复试验才得出这个“解决方案”

NewText->Font->Pitch=TFontPitch.fpFixed
NewText->Font->Pitch=System::Uitypes::TFontPitch.fpFixed

你在这方面做得对,但你使用了错误的语法。使用
而不是

NewText->Font->Pitch = TFontPitch::fpFixed;
NewText->Font->Pitch = System::Uitypes::TFontPitch::fpFixed;
这记录在Embarcadero的DocWiki中:

NewText->Font->Pitch = TFontPitch.fpFixed;
NewText->Font->Pitch = System::Uitypes::TFontPitch.fpFixed;
System::Uitypes::TFontPitch( fpFixed );   // yes,no assignments here just an unused value
NewText->Font->Pitch = fpFixed;
NewText->Font->Pitch = TFontPitch::fpFixed;
NewText->Font->Pitch = System::Uitypes::TFontPitch::fpFixed;