Hiya, my app is always opening, writing and closing files - weird thing is, no matter how often i check the code make sure its all fine, after i open a file 10 or so times it ends up erroring and failing to load, even if i leave a long pause between the load attempts.
it seems pretty random, but its almost as if, once its saved a total amount (in terms of size) it just dies on me
i've tried just running one little peice of code 10 times (with a 5 second pause inbetween) and indeed, it always crashs on the 11th run.. the code is
Any suggestions? should i GpFatInit when my app first loads, should i be calling it everytime i want to save or am i not closing the file correctly or something, its strange
it seems pretty random, but its almost as if, once its saved a total amount (in terms of size) it just dies on me
i've tried just running one little peice of code 10 times (with a 5 second pause inbetween) and indeed, it always crashs on the 11th run.. the code is
sprintf((char*)filename, "M%dS.DAT", map_settings.current_map);
if (GpFileCreate(filename, ALWAYS_CREATE, &h_file) != SM_OK) MsgBox("Error creating M_S.DAT");
if (GpFileOpen(filename, OPEN_W, &h_file) != SM_OK) MsgBox("Error opening M_S.DAT");
if (GpFileWrite(h_file, save_settings, sizeof(unsigned short) * 4) != SM_OK) MsgBox("Error writing M_S.DAT");
if (GpFileClose(h_file) != SM_OK) MsgBox("Error closing M_S.DAT");
Any suggestions? should i GpFatInit when my app first loads, should i be calling it everytime i want to save or am i not closing the file correctly or something, its strange