Tworzę sobie dynamicznie TStringGrida:
Plik nagłówkowy np. Unit1.h
TStringGrid *grid;
void __fastcall MyDrawCell(TObject *Sender, int ACol, int ARow, const TRect &Rect, TGridDrawState State); // Deklaracja metody malowania wyczytałem, że TRect musi być const
Plik źródłowy np. Unit1.cpp
TGridDrawState State) {
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender) {
grid = new TStringGrid(this);
grid->Parent = this;
grid->Visible = true;
grid->OnDrawCell = MyDrawCell;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender) {
delete grid;
}
Kiedy kompiluje otrzymuję:
|
[ILINK32 Error] Error: Unresolved external '__fastcall TForm1::StringGrid1DrawCell(System::TObject *, int, int, Types::TRect&, System::Set<Grids::Grids__3, 0, 5>)' referenced from C:\USERS\XX\DOCUMENTS\RAD STUDIO\PROJECTS\TEST\DEBUG\WIN32\UNIT1.OBJ |
Może ktoś wie o co chodzi ??







