Board index » cppbuilder » Property with parameter
Jet
CBuilder Developer |
Property with parameter2004-08-20 04:56:54 PM cppbuilder59 Hi, good day! I declared a property with index in my control __property AnsiString Cells[int][int] = {read = GetCells, write = SetCells}; but it always causes an access violation. Usually, my read access specifier is a variable, for example, read = FCells. I can initialize this in the constructor. But with a function read access specifier, there are times that the program executes that function even if there is no one calling it (or none, I think so). Here is some lines of the code: class TEditListView : public TListView { private: AnsiString __fastcall GetCells(int ARow,int ACol); void __fastcall SetCells(int ARow,int ACol, AnsiString AStr); __published : __property AnsiString Cells[int][int] = {read = GetCells, write = SetCells}; BEGIN_MESSAGE_MAP VCL_MESSAGE_HANDLER(WM_LBUTTONDOWN, TMessage, WMLButtonDown) VCL_MESSAGE_HANDLER(LVM_INSERTCOLUMN, TMessage, LVMInsertColumn) END_MESSAGE_MAP(TListView); }; When I debug it, the value of ARow and ACol is both 1242780. Is there a special procedure for function read-access specifiers or is it caused by some other forces =) that I can't see? Thanks! |