This topic is now archived and is closed to further replies.


damn fstream

Recommended Posts

WizHarDx    190
Hi I am making the level editor for my game, its working fine but when I save & then load it does not work correctly. In the structure I am saving it has 3 HBITMAPS & 2 Arrays. I am guessing the problem is that the struct contains pointers so it is saving the memory address not the data or something like that , anyways do any of you know how to overcome this problem. thanx in advance WizHarD

Share this post

Link to post
Share on other sites
ATronic    122
be sure when saving to a file to save the objects, like you said, not the pointers. For example.

int* data = MyDataLoader();



You could always write each member of the structure, or make it into a class with a save function. Since I tend to lean towards classes anyway, the second is what I would do.

Alex Broadwin
A-Tronic Software & Design
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post

Link to post
Share on other sites
null_pointer    289
You cannot save the HBITMAPs directly because they are handles. You must get the bitmap header data (dimensions, bits-per-pixel, etc.) and save it into a file yourself. If you do not need a custom format then you should use the Windows bitmap file format (BMP). should have information about this.

Share this post

Link to post
Share on other sites