But now, I have a problem: In resolution 320x200x256: I have a main window with a titlebar and window caption, as well as 2 buttons and a bar control that I made as a separator (like a menu separator - no useful purpose). Then I have a desktop window (With a bitmap loaded from a file - my CTOS stuff), and a plain window with caption and titlebar. For the first window, button1 creates a new window with a close button on each(everytime it is pressed creates a new - the buttons are linked to an event handler function to close the window), button2 closes this(the main) window and frees all it's controls and bitmaps... EVERYTHING that should be freed. and hbar1 (the menu bar) clears the screen and displays the text "hb1 pressed!".
If you press the first button 3 times (create 3 windows), it is fine: Press it once more, and I get an "error while allocating control bitmap" meaning that I cannot allocate a bitmap for a control on a window that is allocated and that means that the whole GUI must die, or it will mess up and take the whole PC with it (I tried ditching that code and that's what happened). The only thing that I can understand about this error is that I somehow have ran out of RAM, so malloc() can't grab anymore memory. >:(
BUT: If I make the new windows without close buttons(via code comments), then I have had about 30 windows created with titlebars(no buttons) with not even a slight speed decrease noticable
Please help me figure out where to start looking... The program is over 2000 lines... I compile in LARGE memory model using BorlandC 3.1 (It's a totally awesome DOS IDE). The compiled executable is ~52KBytes, code is about 54KBytes...
