Now here’s a dangerous and dubious technique for you to try at your own risk– allocate objects on the stack instead of on the heap. Hey, C++ does it all the time! The advantage: object allocation is at least twice as fast on the stack. Disadvantage: only applicable to objects which are local variables. Example …
Category Archives: Delphi
QDB: Quick Database Components
Borland’s Delphi© makes the construction of Windows applications easier than ever. In particular, the Borland Database Engine (BDE) offers enormous power with great ease. Sometimes, however, the full might of the BDE is overkill. Wouldn’t it be better for your simple projects to use a simple tool, one that could be distributed inside your EXE …
Snoop: Memory Leak Sniffer
Writing programs that work at all is difficult enough without having to track down memory leaks and strange problems with overwritten memory. Snoop and Snoop Monitor make it easy to snoop out those bugs — and they’re free. Caveat! It is some years since these components were developed and they won’t function beyond D5. They …
CompDocs: Structured Storage Wrapper
OLE Structured Storage (or Compound Documents or DocFiles … the names change regularly!) provide a clever way to have a whole file-system within a single file with nested ‘directories’ (storages) and ‘files’ (streams). There’s also the ability to do transaction processing: keeping modifications in limbo until ‘committed’ or rolled-back. The only catch has been that …
Widgets: Title-Bar Buttons
Another title-bar button? Yes, but one that works simply and cleanly to provide buttons which mimic the look and feel of Windows’ own frame controls by using Windows’ own drawing technique. Each Widget contains a single glyph from a truetype font. Windows uses the “Marlett” font for its own glyphs but you can use any …
Maps: Generic Associative Containers
The Maps Library offers nine genuine generic container classes. Just as TStringList lets you keep lists of objects indexed by a string value, Maps let you keep lists of just about any type, object or atomic, indexed by whatever type you like. The nine different kinds of map have different performance characteristics allowing you to …
FirstAid
Every so often the Delphi IDE (from D2 until at least D7) seems to get confused about its line numbers: errors are reported in places there is no code; the debugger jumps about with no apparent relation to the code that is being executed. The Delphi newsgroups propose many diagnoses but, in my experience, the …