Hola.
El error se produce, con seguridad, en la línea:
Código:
TDate FechaCell = StrToDate(StringGrid1->Cells[0][ARow]);
En algún punto, el contenido de Cells[0][ARow] no es un valor susceptible de ser convertido a fecha, situación que sucedería por ejemplo, si en la fila 0 existiesen títulos para las columnas.
Una solución es:
Código:
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
TCanvas *CV = static_cast<TCanvas*>(StringGrid1->Canvas);
TDate FechaCell;
if (TryStrToDate(StringGrid1->Cells[0][ARow],FechaCell))
if (FechaCell >= FechaInicio && FechaCell <= FechaFin) {
CV->Brush->Color = clLime;
CV->FillRect(Rect);
CV->TextOut(Rect.Left+1,Rect.top+1,StringGrid1->Cells[ACol][ARow]);
}
}
(Siempre suponiendo que en la columna 0 del StringGrid haya un contenido de fecha válido.)
Saludos.