devxlogo

Tip Bank

Sort Data in the Short Date Format

Suppose you have a database field that returns a date in the Short Date format. Neither a numeric sort nor a string sort would order this column correctly. To sort

Progress Bars With A Gradient

The tip “Color Status Indicator” [“101 Tech Tips for VB Developers,” Supplement to the February 1997 issue of VBPJ, page 26] got me thinking that it would look even more

Compress Short Strings Into a Long Value

When developing relational database applications, you often need to use list boxes or combo boxes to store records with alphanumeric keys. You can load numeric keys into the ItemData array

Add User Properties to Controls

To add user-defined properties to controls, use this code to store them in the control’s tag. You can define multiple additional properties at design or run time. You can easily

Placement-New Requires Heap-Allocated Buffers

The placement-new operator constructs an object on a pre-allocated buffer. The pre-allocated buffer has to be allocated on the heap. char *pbuff = new char[1024]; // heap allocation using plain

Generic Programming: One Step Beyond OOP

The Standard Template Library (STL) is a collection of generic algorithms and containers. It provides a new approach in software development, namely, generic programming. How does generic programming differ from

Fully Qualified Names

A unique name of an identifier consists of its namespaces(s), each followed by scope resolution operator, then its class name, and finally the variable itself. Since both namespaces and classes