Memory problems (heap problems????)

On Thu, 31 Oct 1996 12:36:27 +0100 (MET), Jacob Heder

<> wrote:
>Programmning a windows procedure that enables me to make a graphic
>window (just like windiws 3.11 and 95)  and save the background behind
>the windows give me hard problems:

>1) If the windows have the size of the total screen size (normal vga) a
>have to use 4 pointer of the variabel size. If I don't do this the
>computer crashes.

>2) Opening more than one windows saveing the background behind the
>   should enable me to swiths between them, but the computer crashes

>  I seems like I do not under stand the Heap, sow I need some help

Dear Jacob Heder,

I Assume that your problem has mainly to do with needing more heap
memory than is available. A single 640x480x16 screen does need 150 Kb
(uncompressed) to be stored on the heap. Two screens would need 300
Kb! Clearly this is not the right way to proceed in a DOS real mode
The best solution in your case would be to use an XMS memory driver
(if you have enough memory), or use a swap file on your hard disk
(which will be quite slow). The big advantage of XMS is that you can
store chunks of data which are much bigger than 64 Kb.
You could, of course, switch to protected mode (BP 7.0), but that
would create a whole set of other problems.

Peter de Jong