Board index » cppbuilder » Package problems
Wiljo de Ruiter
![]() CBuilder Developer |
Package problems2004-10-05 06:13:44 PM cppbuilder15 Hello, Another problem we are now encountering has to do with multiple packages. Instead of using libraries, a program can also be a compilation of packages. Up to now we only used three packages, and never had a prblem with them. But these packages were becomming so big that they needed to be split up into several smaller ones with each containing sources of the same kind, e.g. one package for dealing with only graphics, and another package for memory handling, including file management. Two of the three packages have been split up in to seven smaller ones. One contains a static object, that has a constructor that is called once at the start of the program. This object defines a linked list, that assigns a directory path to a unique name, an alias. Throughout the program we can then use this alias to change to a directory. This list is filled from an ASCII configuration file. We can modify directories in the configuration file, and still have a working program without recompiling it. The problem arises when we want to store or retrieve aliases from within different packages. The static object seems to move all over the place. I mean this exactly. When debugging our code, and specifically looking at the <this>pointer of the object, it's value changes all the time, but it's contents will be lost. The contents is only correct when the right value for the <this>pointer comes around. We have functions to set or get the contents of this list object. These functions are used throughout the packages and program. The call origin of these functions seem to determine the value of the object's address (and thus the this pointer of it). When the call originates from a source in the executable everything works fine, but when the call originates from a source inside a sub package, the executable is using, then the list object is momentarily lost. The program doesn't crash, simply doesn't do what it supposed to do. Can anyone help me solve this problem? Wiljo. |