Tip Bank

DevX - Software Development Resource

Avoid Improper Inheritance

Using public inheritance with two classes that do not fully comply with the is-a relation (although they are related to one another) is a common design mistake. For example, deriving

DevX - Software Development Resource

Beware of Using setjmp and longjmp

Using a longjmp() in C++ is dangerous because it jumps out of a function, without unwinding the stack first. Consequently, destructors of local objects are not invoked. As a rule,

DevX - Software Development Resource

Is the Array Dimensioned?

Use this function to determine whether a dynamic array has been dimensioned. I use dynamic arrays to store small, foreign key tables locally for fast lookups. Not wanting to load

DevX - Software Development Resource

Quick Check on Collection Key

You might need to determine whether a certain key is in a collection. The Collection object doesn’t provide a method to retrieve a key after you add an object to

DevX - Software Development Resource

Set the Width of a ListView Column

The ListView Windows control has some additional features that haven’t been exposed in the OCX provided with VB. One feature can shrink or enlarge columns automatically to ensure that data

DevX - Software Development Resource

Keep Track of Global Variables

Forgetting the names of global variables is easy to do. You can solve this problem by letting VB remember the variables for you by making the variables into fields of

DevX - Software Development Resource

Do You Know About Date Literals?

Using a Date literal is about 12 times faster-according to NuMega TrueTime-than using the CDate function and converting a string literal. Here’s an example: Dim TestDate as Date ‘The following

DevX - Software Development Resource

Perform Look-Ahead Typing

This subroutine lets the user perform look-ahead typing, as in Netscape Navigator, Microsoft Internet Explorer, and other apps. The sub takes an array of strings and a TextBox control as

DevX - Software Development Resource

Use Brackets to Keep VID 6 Happy

When you use the Scripting Object Model (SOM) in Visual InterDev 6, keep in mind that the script library is biased towards JavaScript. Your perfectly valid VBScript may produce strange