Click here to Skip to main content
15,891,248 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CListCtrl & theCtrl = GetListCtrl Pin
David Crow19-Dec-10 14:09
David Crow19-Dec-10 14:09 
QuestionClass CxxxxView:CFormView Pin
cy163@hotmail.com13-Dec-10 4:00
cy163@hotmail.com13-Dec-10 4:00 
AnswerRe: Class CxxxxView:CFormView Pin
«_Superman_»13-Dec-10 7:20
professional«_Superman_»13-Dec-10 7:20 
GeneralRe: Class CxxxxView:CFormView Pin
cy163@hotmail.com13-Dec-10 15:42
cy163@hotmail.com13-Dec-10 15:42 
GeneralRe: Class CxxxxView:CFormView Pin
«_Superman_»13-Dec-10 16:00
professional«_Superman_»13-Dec-10 16:00 
GeneralRe: Class CxxxxView:CFormView Pin
yu-jian14-Dec-10 17:56
yu-jian14-Dec-10 17:56 
GeneralRe: Class CxxxxView:CFormView Pin
cy163@hotmail.com15-Dec-10 19:51
cy163@hotmail.com15-Dec-10 19:51 
Questionhow to Read/Write to a file a structure wich contains Cstring ? Pin
timbk13-Dec-10 2:30
timbk13-Dec-10 2:30 
Hello, I have to Write/read a file with a structure wich contains CString data, if drop out the CString data from the structure it works but if I left the CString data the program crashes when attemps to read.
Here the structure
struct MyStructure
{
CString label//For others data types char, BYTE, etc it works but for CString it doesn't 
unsignet char data1
BYTE data2
}


the writing
    struct MyStructure Estructura;
    CFile FileConfig;              

FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite);
     FileConfig.Seek(0,CFile::begin);
     FileConfig.Write(&Estructura,sizeof(Estructura));
     FileConfig.Close();


the reading
	struct MyStructure Estructura;
	CFile FileConfig ;		  

FileConfig.Open("ROMconfig.dat",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeRead);
	FileConfig.Seek(0,CFile::begin);
	FileConfig.Read(&Estructura,sizeof(Estructura));
        FileConfig.Close();

What I'm doing wrong, may be is something in relation with CString size, but I'm not sure.
And the file has to be a .dat file because is modification to an older application.
AnswerRe: how to Read/Write to a file a structure wich contains Cstring ? Pin
Cedric Moonen13-Dec-10 2:43
Cedric Moonen13-Dec-10 2:43 
GeneralRe: how to Read/Write to a file a structure wich contains Cstring ? Pin
timbk13-Dec-10 3:21
timbk13-Dec-10 3:21 
GeneralRe: how to Read/Write to a file a structure wich contains Cstring ? Pin
Cedric Moonen13-Dec-10 3:25
Cedric Moonen13-Dec-10 3:25 
AnswerRe: how to Read/Write to a file a structure wich contains Cstring ? Pin
Richard MacCutchan13-Dec-10 7:19
mveRichard MacCutchan13-Dec-10 7:19 
QuestionSHFileOperation in win XP? Pin
zon_cpp12-Dec-10 19:23
zon_cpp12-Dec-10 19:23 
AnswerRe: SHFileOperation in win XP? Pin
CPallini12-Dec-10 20:59
mveCPallini12-Dec-10 20:59 
GeneralRe: SHFileOperation in win XP? Pin
zon_cpp12-Dec-10 22:24
zon_cpp12-Dec-10 22:24 
Questionsave image with annotation Pin
raju_shiva12-Dec-10 18:53
raju_shiva12-Dec-10 18:53 
AnswerRe: save image with annotation Pin
Hadi Dayvary13-Dec-10 7:02
professionalHadi Dayvary13-Dec-10 7:02 
QuestionException Pin
MsmVc12-Dec-10 18:38
MsmVc12-Dec-10 18:38 
QuestionRe: Exception Pin
CPallini12-Dec-10 21:08
mveCPallini12-Dec-10 21:08 
AnswerRe: Exception Pin
MsmVc12-Dec-10 22:22
MsmVc12-Dec-10 22:22 
QuestionRe: Exception Pin
CPallini12-Dec-10 22:30
mveCPallini12-Dec-10 22:30 
AnswerRe: Exception Pin
MsmVc12-Dec-10 22:59
MsmVc12-Dec-10 22:59 
QuestionDear buddy, I am mad, can you help me and don't drop me as sacrifice Pin
nenfa12-Dec-10 16:58
nenfa12-Dec-10 16:58 
AnswerRe: Dear buddy, I am mad, can you help me and don't drop me as sacrifice Pin
nenfa14-Dec-10 15:09
nenfa14-Dec-10 15:09 
QuestionCan not delete multiple files with ReadDirectoryChangesW Pin
ShadowUz12-Dec-10 13:30
ShadowUz12-Dec-10 13:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.