Hi All,
I am working on a project where i need to import a binary file into a RichEdit. I searched all over and i could not find any help about this.
When i import the binary file, the most bytes are gone, it shows only the bytes that appeared to be ANSI code. so byte 0-32 are erased by RichEdit(i think)
I tried to put plaintext on, but that wont fix the problem.
Is there any way to import a complete binary file into RichEdit. It would be nice if the characters where shown as hex in stead of text.
The code i am using:
RichEdit1->Lines->LoadFromFile(OpenDialog1->FileName);
Kind Regards,
Midas
Comments
#include
#include
int main () {
char * buffer;
long size;
ifstream file ("example.dat", ios::in|ios::binary|ios::ate);
size = file.tellg();
file.seekg (0, ios::beg);
buffer = new char [size];
file.read (buffer, size);
file.close();
cout << "the complete file is in a buffer";
delete[] buffer;
return 0;
}
Cheers!
midas