I am a C++ programmer using the DEV C++ compiler. I created a tile-based map editor and also created a header file to allow the maps to be loaded into other programs. The maps are saved in the ".dat" format.
When I was using XP, the editor and all of my programs using the header file worked flawlessly; however, now that I have Vista, the map loading does not function properly.
When I save the file and then immediately load the same file in the editor, it loads properly until I close the program and run it again.
Also, the file sometimes loads maybe three times if I just run the program, but after that it won't load anymore.
I monitored the program's actions and apparently the program is able to extract the map's data, but it closes after it exits the function.
I use the very same file saving and loading method in other programs, but they do not crash when the code is executed.
The map files are 1.74 MB in size.
Could someone please explain why this occurs?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> I am a C++ programmer using the DEV C++ compiler.
Dev-C++ is not a compiler.
> Could someone please explain why this occurs?
Yes; your code has a bug. What more can we say without seeing the code!? The fact that it runs on one machine and not another is irrelevant. The symptoms indicate perhaps uninitialised data or buffer overrun. The results of such errors are non-deterministic, and that includes apparently working correctly.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a C++ programmer using the DEV C++ compiler. I created a tile-based map editor and also created a header file to allow the maps to be loaded into other programs. The maps are saved in the ".dat" format.
When I was using XP, the editor and all of my programs using the header file worked flawlessly; however, now that I have Vista, the map loading does not function properly.
When I save the file and then immediately load the same file in the editor, it loads properly until I close the program and run it again.
Also, the file sometimes loads maybe three times if I just run the program, but after that it won't load anymore.
I monitored the program's actions and apparently the program is able to extract the map's data, but it closes after it exits the function.
I use the very same file saving and loading method in other programs, but they do not crash when the code is executed.
The map files are 1.74 MB in size.
Could someone please explain why this occurs?
> I am a C++ programmer using the DEV C++ compiler.
Dev-C++ is not a compiler.
> Could someone please explain why this occurs?
Yes; your code has a bug. What more can we say without seeing the code!? The fact that it runs on one machine and not another is irrelevant. The symptoms indicate perhaps uninitialised data or buffer overrun. The results of such errors are non-deterministic, and that includes apparently working correctly.
Clifford