Essential Tools Module User's Guide : Chapter 13 Common Mistakes : Keep Related Methods Consistent
Keep Related Methods Consistent
When you design classes that will be used with the Essential Tools Module, you may be tempted to take short cuts, like providing a simplistic hash method, or operator<(), since you “know it will never be used anyhow.” Decisions like this can have disastrous maintenance consequences later. Unless you have a very good reason, it makes sense to ensure, for example, that operator<(), operator==(), compareTo(), and isEqual() are based on the same information. You must also be sure that values which are isEqual() or == with each other have the same hash value, since otherwise they will never be found if placed into a collection that uses hashing techniques. A little extra effort at the beginning can pay big dividends in reduced debugging time later on!
DLL
Because the DLL version of the Essential Tools Module uses the large memory model, any data segment that uses it must be fixed. For example, if you were to create an RWCollectable object in your data segment and insert it into an Essential Tools Module collection, that collection will be holding a four byte pointer. If your data segment were to move, the pointer would no longer be valid. Hence, be sure that your .DEF definition file has a line similar to the following:
 
DATA PRELOAD FIXED
Note that with Microsoft's decision to abandon real mode Windows, working with fixed data and global memory is no longer the problem it used to be. The extra level of indirection offered by protected mode allows data to be moved around in physical memory without invalidating selectors. The entries in the descriptor table are changed instead.