hi, im trying to output my files contents in binary to a memo window in my program but im having some problems in the fact that it will only print out the first couple of bytes of the file into my window. I think the problem is that i need to create a loop through my buffer until it is empty (just a guess) but i did not know how to construct this. I added a line right near the bottom (commented out) which i thought would have done the trcik but it throws back an error saying i have called too many arguements.
If anyone could pass on any suggestions i would be very appreciative
thanks
Code:
TListItem * Item2 = ListView2->Selected;
if(Item2)
{
/**************************************************************************/
AnsiString text = Item2->Caption;
TStrings * subItems = Item2->SubItems;
AnsiString text1 = subItems->Strings[0]; // Getting the designated subitem names from table
AnsiString text2 = subItems->Strings[1];
int startPoint = text1.ToInt();
int fSize = text2.ToInt();
/ ********************************************************************************
*/
/*********************BUILDING THE FILES**************************/
AnsiString EvidenceFile = Label2->Caption; //getting evidence file path from lable
char *buffer = new char[fSize];
ifstream myFile (EvidenceFile.c_str(), ios::in | ios::binary);
myFile.seekg (startPoint,std::ios::beg);
myFile.read(buffer, fSize*sizeof(char));
Memo1-Lines->Add(buffer); //adding the output of my file
//Memo1-Lines->Add(bufferf, Size*sizeof(char)); THIS LINE WONT WORK, STATES TOO MANY ARGUEMENTS
}
}