reading in file memory problems in vc++ 6
Posted on 2007-07-27
hi, i'm having problems with my program.
i'm reading in a file which contains information which is added into my structure. If i read the file in once it works fine. However if i try and read in the same or another file it crashes giving a user break called from code exception. I also get an access violation if i open a file and then exit the program (whether these are related i'm not sure).
anyway, using break points i tracked the point of the exception being thrown to here
addButton(tHook, tText, tClass, tX, tY, tWidth, tHeight, tAnchor, tProgram, tOutput, tFields);
this method doesn;t get called and according to the debug all the CString vars are filled. These are global vars that i reuse every time i read a file in.
CString tHook, tClass, tText, tOutput, tProgram;
int tAnchor, tX, tY, tWidth, tHeight;
i simply assign the string token to the CString like so
tClass = token;