Skip to main content

Problem:

A window containing a toolbar war pushed/used several times by dialog system.

After a while the icons in the toolbar get black and a few cycles later the program was stopped by a runtime error.

The program ran out of memory.

Resolution:

This problem was caused by a missing finalize for the object "buttonImageList" in the "OnDestroyed"-Section of the toolbar control program which was generated some years ago when creating the screen set.

The object "buttonImageList" needs to be finalized like:

          IF buttonImageList NOT = NULL

             INVOKE buttonImageList "finalize"

                                     RETURNING buttonImageList

          END-IF

This was added to the generator in Jun 2003 and appeared in the following web sync package, so today the actual generator will create the control program containing these lines.

But the problem persists, because a correction in the generator does not affect generated programs.

After generating a control program, the generator is never used again, because the control program gets changed by the programmer - this is the concept working with programmed controls.  Regenerating the control program would force a re-do of all manual changes to that program.

Avoiding this will need to follow different concepts. Net Express 5.0 offers the usage of the Visual Studio 2005 painter for the GUI interface. The painter gererating forms consist of 2 program files which together build one object oriented class. One file contains the generated parts and should never be changed manually - the other file conatins the user programmed parts. By this concept the generator can be updated and the correction can easily flow into existing programs.

Old KB# 1535