The Latest

DevX

Simplify Creating and Adding Menu Items

When creating menu items and adding them to a menu, you can shorten your code by combining two steps into one. Instead of creating the menu item and adding it

DevX

Data Pointers vs. Function Pointers

C and C++ make a clear-cut distinction between two types of pointers: data pointers and function pointers. A function pointer embodies several constituents such as the list of arguments, a

DevX

When to Use a Pure Virtual Member Function

A pure virtual function is merely an interface and can be thought of as a way to enforce policy. A pure virtual function should be used when subclasses implement the

DevX

Integer Affixes

You can use affixes to help the compiler figure out the correct type of a hard coded integer. The letter L affixed to a number indicates a long integer and

DevX

Elaborated Type Specifier

An elaborated type specifier is a type name preceded by one of the keywords: enum, struct, union, and class. You can use an elaborated type specifier to instantiate an object

DevX

Using bsearch the Right Way

Standard C defines the function bsearch, which performs a binary search on an array of elements. The function bsearch is very efficient, but it works only on sorted arrays. You

DevX

The Perils of a Container’s Reallocation

When a container reallocates its elements, their addresses change correspondingly. Consequently, the values of existing iterators are invalidated: #include #include using namespace std;void main() { list payroll; payroll.push_back(5000.00); list::iterator p

DevX

Pointers to Members of a Template Class

You can define a pointer to a class template member. For example, you can use the specialization vector: typedef void (vector< int >::*v_vi_szt) (size_t); // v_vi_szt is used to hide

DevX

The begin() and end() Member Functions of STL Containers

All STL (Standard Template Library) containers provide the begin()/end() pair of member functions. The member function begin() returns an iterator that points to the first element of the container: vector

DevX

Reflecting on a Classy String

Java’s reflection API allows the instantiation of an object using only its String description. A Java application can determine the class of an object from the associated string and then

DevX

Putting out the Trash Using the gc() Call

The gc() call on the Java Virtual Machine’s garbage collector is often misunderstood. One of the reasons Java is such an easy language to program in is that it takes

DevX

Efficient Use of the Vector Class

The Vector class in java.util is one of the most frequently used classes in Java development. It almost makes the problem of memory management non-existent, unlike a fixed-size array. However,

DevX

Disappearing Exceptions

A thrown exception is guaranteed to be caught Related Posts iOS 17.1 Update Eradicates Screen WoesSurvey Offers Advice on How to Keep Mobile Developers HappyCERN detects quantum entanglement in top

DevX

Add a MIME Type to IIS 4

When you want to serve up a new type of file that Microsoft’s Internet Information Server (IIS) does not recognize, you need to add a MIME type. With older versions

DevX

Make Your Cookies Live Longer

When using ASP to create browser cookies, by default the cookie is alive only as long as the browser is running. You can make cookies last longer by defining an

DevX

Stop Web Crawlers From Indexing Your Page

Using a file named ROBOTS.TXT in your root directory allows you to control the indexing behavior of most Web crawlers with respect to your site (search engines like AltaVista use

DevX

Const Iterators

You can think of an iterator as a pointer to elements of a container. All STL (Standard Template Library) containers provide the basic iterator type along with its const counterpart.

DevX

Force a Single Select for a Grid

Setting the SelectionMode property of the MSFlexGrid to flexSelectionByRow forces all columns in a row to be selected rather than a single cell. It also allows selection of multiple rows

DevX

Setting Layer/DIV Background Colors

Often it is desirable to set a background color for an entire layer or DIV region, much like setting the background color for a whole table. Setting a layer background

DevX

Stacking Layers Above Embedded Objects

When designing a Web page that contains CSS layers (DIV sections) and embedded objects (Java applets, plugins, or ActiveX controls), keep in mind that embedded objects do not obey zIndex

DevX

Modernize Your Toolbar Look

Using only a few Windows API calls, you can change the standard VB5 toolbar into an Office 97 look-alike. I’ve implemented two display styles for the toolbar. The first allows

DevX

Copy Drawn Picture to Clipboard

The VB Picture control can hold several different formats of pictures: BMP, DIB, ICO, CUR, WMF, and others under VB5. Additionally, you can use graphics methods to “draw” on the

DevX

Floating an Edit Box

To minimize the number of controls on my forms, I use a text box as a floating input control that I either overlay onto a grid or swap with a

DevX

Erase a Variant Array

You’ll find the IsArray() function helpful when you use Variant arrays that you can set or unset through your code and need to test often. However, once you declare the