Hola andres_89.
Ejemplo usando STL:
Código PHP:
#include <fstream>
...
{
AnsiString nombrearchivo = "Reporte.txt";
std::ofstream ofs;
TListView* lv = static_cast<TListView*>(ListView1);
ofs.open(nombrearchivo.c_str(), std::ofstream::out | std::ofstream::app);
for(int i = 0; i < lv->Items->Count; i++)
ofs << (lv->Items->Item[i]->Caption + "," +
lv->Items->Item[i]->SubItems->Text).c_str();
ofs.close();
}
Saludos