Board index » cppbuilder » property is not read from dfm? Please help
Jean
![]() CBuilder Developer |
property is not read from dfm? Please help2005-10-27 01:48:02 AM cppbuilder59 Hello, I'm trying my hand a bit at component writing but no matter what I try, it seems values set in the object inspector are written into the .dfm file but do not show up in the code. I made below an example as simple as possible. What is wrong with this code? No matter what I set in the object inspector for 'Max', the messagebox always says it's 15. The .dfm file contains the value set in the object inspector though. Thank you. header file //--------------------------------------------------------------------------- class PACKAGE TMru : public TComponent { private: int FMax; protected: public: __fastcall TMru(TComponent* Owner); __published: __property int Max = {read=FMax,write=FMax}; } cpp file, only contains generated stuff and a bit in the constructor //--------------------------------------------------------------------------- __fastcall TMru::TMru(TComponent* Owner) : TComponent(Owner) { FMax = 15; if (!ComponentState.Contains(csDesigning)) { String S = IntToStr(FMax); MessageBox(NULL, "fmax", S.c_str(), MB_OK); } } -- Using Opera's revolutionary e-mail client: www.opera.com/mail/ |