Ive compiled an executable witch has a few large bitmaps in its Resources. After ive loaded it with directx, i no longer need the them to be in the memory (i think). In fact i dont think i need the .rsrc section at all after that. Anyhow, my question; would it be worthwhile in anyway to unload this from memory seeing as im not going to be using it for anymore? If so, how would i go about doing this?
Another thing; Is it possible to make a section in a PE which is not loaded into memory on execution?
Thx :U
Red,
As long as an EXE is not compressed, the OS is supposed to do this style of paging for you but you don't have much control of how it works. With a one off use of a bitmap, it sound like a perfect candidate for a DLL that uses LoadLibrary() GetProcAddress() which can be unloaded when you have the bitmap you want in seperate memory and you have perfect control of this mechanism.
Thats a nice idea, but errm...... as a kindof point, im trying to keep it to a single executable without any libraries (aka. dongles and doodles). If the OS handles it already, then ill just twiddle my thumbs and keep on going. :bg
Thanks hutch
Hi Red, i dont know is resource flag DISCARDABLE still usefull, but try... Also it's can be specified for entire section in linker options(D) like R or W or E for read,write and execute...
If they are large, why not to store your images as bitmap files?
^^ as i was saying before, im trying to keep it in one neat executable, no extra files. Its kindof a point i want to make to a friend.
Its sounds to me like the OS handles it so im not worried really; just trying to keep my programs from resource hogging.