CFile::ReadHuge question
-
Hello everybody, I'm reading a .jpg file, everything goes fine, readhuge reports reading the hole file but what I've got in the buffer is just 4 bytes. What is ReadHuge reading ? code: buffer = new char[1000000]; if (buffer == NULL) { cout<<"Not enough memory"; return; } try { imageFile.Open(fileTitle,CFile::modeRead,&e); imageFile.ReadHuge(buffer,1000000); imageFile.Close(); CString output = header + buffer; imageFile.Open("msg01",CFile::modeCreate | CFile::modeWrite,&e); imageFile.WriteHuge((LPCTSTR) output,output.GetLength()); imageFile.Close(); delete []buffer; }
-
Hello everybody, I'm reading a .jpg file, everything goes fine, readhuge reports reading the hole file but what I've got in the buffer is just 4 bytes. What is ReadHuge reading ? code: buffer = new char[1000000]; if (buffer == NULL) { cout<<"Not enough memory"; return; } try { imageFile.Open(fileTitle,CFile::modeRead,&e); imageFile.ReadHuge(buffer,1000000); imageFile.Close(); CString output = header + buffer; imageFile.Open("msg01",CFile::modeCreate | CFile::modeWrite,&e); imageFile.WriteHuge((LPCTSTR) output,output.GetLength()); imageFile.Close(); delete []buffer; }