devxlogo

Tip Bank

Designated Initializers

Another new feature in C99 is called designated initializers. Designated initializers enable you to initialize specific array elements without having to initialize the entire array. For example, suppose you have

Reading Strings that Contain White Spaces

The std::getline() functions reads data from an input stream and writes it to a string object. Unlike cin’s >> operator, getline() also reads white spaces, which makes it useful for

Changing the Endian-ness of a Number

Suppose you receive an int from a remote host and you wish to convert it to big-endian order. Here is another portable solution for handling of big and littleendian data

Draw Lines in a List View

This code adds the appearance of a grid control to a traditional listview, drawing lines between rows and columns: Private Declare Function SendMessageLong Lib

Logon Improvements

If your application connects to Microsoft SQL Server, you can use two features to make your login easy and low maintenance. The first choice is to use OLE DB instead

Create New Controls at Run Time

This undocumented feature of VB6 lets you create new controls at run time. In previous versions, one had to create a control array at design time in order to be

Error Message Passing Throughout Nested Components

Nowadays, components are popularly used in VB projects. These components can sometimes make it hard to determine which component has an error when the application stops running. This is especially