My application during run causes a debug assertion failed with an expression _BLOCK-TYPE_IS_VALID(pHead->nBlockUse) in the file dbgheap.c (line 1017).
I understand that the problem is related to some kind of memory allocation and nothing much beyond this. I am writing and reading structs to/from files created in the program. The application reads from the created file but then gives the aforementioned error message.
First in the class Change_setting (derived from CDialog) I have written a file by the name "Group". For writting the file I am using a structure type.
Then in another class (of the same project)CLPDATADlg(again derived from CDialog) I try to read the file with the same structure. But after reading the file it gives the above error:
Below is the code for writting and reading files.
struct Configuration Config1;
fstream file("GROUP", ios:ut|ios::in);
Config1.portAdd = strtol(str4,&end,16);
Config1.TimerClk = strin7;
struct Configuration1 Config2;
fstream in("GROUP", ios::in|ios::binary);
portA = Config2.portAdd;
Please help me.....I am very badly stuck.