A
Axel
Hiho,
here my Newbie question (Win32 GUI):
I'm reading a file in binary mode to a char* named buffer. I used
malloc(filesize) to make the needed space avaiable. The filedata in the
buffer seems to be ok..I can write the variable buffer back to a file
and the contents is ok. So I think until here all goes fine...
But now I want write the buffer contents to a Memo-Box for displaying.
It works...but only the first 4 or 5 letters are shown. I have no idea
how to get the whole buffer-variable into the String of the MemoBox
component for displaying.
Here is the part of my code:
..
..
..
int fsize = FileSizeByName(file); //Filesize
char *buffer = (char*)malloc(fsize); //allocate buffer for filedata
fseek(filereader, SEEK_SET, 0);
fread(buffer,fsize,1,filereader); //read binary data in buffer
Memo1->Text = buffer; //Memo1 displays buffer as String
free(buffer);
..
..
..
I hope I illustrated the problem right and somebody has an idea whats wrong.
Thanks in advance!!
Axel
here my Newbie question (Win32 GUI):
I'm reading a file in binary mode to a char* named buffer. I used
malloc(filesize) to make the needed space avaiable. The filedata in the
buffer seems to be ok..I can write the variable buffer back to a file
and the contents is ok. So I think until here all goes fine...
But now I want write the buffer contents to a Memo-Box for displaying.
It works...but only the first 4 or 5 letters are shown. I have no idea
how to get the whole buffer-variable into the String of the MemoBox
component for displaying.
Here is the part of my code:
..
..
..
int fsize = FileSizeByName(file); //Filesize
char *buffer = (char*)malloc(fsize); //allocate buffer for filedata
fseek(filereader, SEEK_SET, 0);
fread(buffer,fsize,1,filereader); //read binary data in buffer
Memo1->Text = buffer; //Memo1 displays buffer as String
free(buffer);
..
..
..
I hope I illustrated the problem right and somebody has an idea whats wrong.
Thanks in advance!!
Axel