![]() |
|
strange problem with packfiles |
waldermort
Member #6,259
October 2005
|
I have 2 simple functions, 1 for saving the other for loading:
Now this works exactly as it should do, with one strange problem. If I build the exe, export all the files to a seperate directory and run (including the packfile), it works. If I delete te packfile and run the exe, it crashes. Now I have included a check in the code, so it should not be doing this, it should simply load the default values. A little twist to this problem, if I do exactly the same from within MSVC (i.e. delete the generated packfile) it works. Due to this I am unable to debug it and find out where the problem lies. [EDIT] I did something a little stupid, I deleted the .dat file instead of the .set file. A little stupid I know, but they share the same icon, which I must now go and add code for to give it it's own icon. |
Elverion
Member #6,239
September 2005
![]() |
Maybe you should change your check to "if file exists" rather than !packfile_open. If the file is not found, it might return some non-zero number still and could be why you are having problems. It says it should return NULL in the manual, but who knows... -- |
Evert
Member #794
November 2000
![]() |
Quote: If the file is not found, it might return some non-zero number still and could be why you are having problems. It doesn't return a number, it returns a pointer to a PACKFILE struct. Quote: It says it should return NULL in the manual, but who knows... If it doesn't, it's a bug that should be fixed (but it actually does return NULL). Quote: I did something a little stupid, I deleted the .dat file instead of the .set file. A little stupid I know, but they share the same icon
You're not hiding the extensions, are you? |
waldermort
Member #6,259
October 2005
|
Quote: You're not hiding the extensions, are you?
Now that would be a good excuse, a good way to save a little face perhaps, but the answer is no I can't explain why I did it, perhaps I automaticaly deleted the last file in the list (which should be the last file created/added). But obviously i was wrong. This'l teach me to be a little more careful in the future. One good thing to come out of this is noticing my failiure to code a check for the datafile. I am now trying to find out how to manipulate the registry as to add an icon for these .set files. |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
I've associated allegro programs with extensions by simply double clicking on them and when the "Open With" thing comes up, click on Browse to get to the program and make sure the "Always open with this program" is checked. They all watch too much MSNBC... they get ideas. |
waldermort
Member #6,259
October 2005
|
That would work, but only on your system. I don't want the users of my programs to be making these mistakes (not that they should be in those folders anyway). I just add a few lines of code to set the registry. Now those files have their own Icons and settings on all systems. |
|