Hi,
i'd like to save in a binary file a struct like this:
struct SComm
{
CString str1;
CString str2;
CString str3;
unsigned short sh1;
BOOL A1;
CString str4;
CString str5;
};
ok now if i write in a file
SComm c;
file.Write(&c, sizeof(SComm));
it seems ok but if i read it by opening the file as binary i don't get the strings but a series of bad caracters.
i know i can convert CString in char and it will work but i want to know if it is possible work with CString elements.
thanks
Davide
i'd like to save in a binary file a struct like this:
struct SComm
{
CString str1;
CString str2;
CString str3;
unsigned short sh1;
BOOL A1;
CString str4;
CString str5;
};
ok now if i write in a file
SComm c;
file.Write(&c, sizeof(SComm));
it seems ok but if i read it by opening the file as binary i don't get the strings but a series of bad caracters.
i know i can convert CString in char and it will work but i want to know if it is possible work with CString elements.
thanks
Davide