thanks! it was the first time that i used feof().

i have solved it like that now:

long length;
while(fread(&length, sizeof(long), 1, fp)) // while not eof
{

please download it again if you have the old version!