devxlogo

The Latest

Let the user build a connection string

You can programmatically display the standard DataLink property dialog box to let the end user manually build a connection string, that you can later assign to the ConnectionString of an

Don’t hard-code font names and size

Unless you have good reason to do otherwise, you should always use standard fonts in your programs, because this ensures that your application will work on every Windows system.If you

Undocumented behavior of the CInt() function

The CInt() function rounds to the nearest integer value. In other words, CInt(2.4) returns 2, and CInt(2.6) returns 3. This function exhibits an under-documented behavior when the fractional part is

Move Animated GIFs Across a Web Page

Question: I’m trying to make an animated GIF move across a Web page, but the animation freezes in both Internet Explorer 4 and Netscape Navigator 4. I tried to do

Avoid Integer Overflow

When working with integer expressions there is often the risk of raising the “Overflow” error. More specifically, there can be two occasions when this frequently occurs:When you multiply or add

ProgIDToCLSID – Convert a ProgID into a CLSID

Private Declare Function CLSIDFromProgID Lib “ole32.dll” (ByVal lpszProgID As _ Long, pCLSID As Any) As LongPrivate Declare Function StringFromCLSID Lib “ole32.dll” (pCLSID As Any, _ lpszProgID As Long) As LongPrivate

CLSIDToProgID – Convert a CLSID into a ProgID

Private Declare Function ProgIDFromCLSID Lib “ole32.dll” (pCLSID As Any, _ lpszProgID As Long) As LongPrivate Declare Function CLSIDFromString Lib “ole32.dll” (ByVal lpszProgID As _ Long, pCLSID As Any) As LongPrivate

Fly the Flag

The clock applet that comes with Microsoft Plus! has an interesting feature: Its window is round instead of rectangular. Surprisingly, giving your form an odd shape is easy. Add this

Watch the Parens

If you want to pass a parameter to a subroutine, use this code: Call doFormat(txtPerson) You can also call the subroutine without the Call statement. However, if you don’t include

Dictionary Has Advantages Over Collections

The Dictionary object can contain items, which can be any form of data, just like a collection. However, the Dictionary object has many advantages over a collection. It allows retrieval

Display Two Fields

Let’s say you want to bind your listbox to a recordset, but you also want to display two fields concatenated together, such as “Jones, Barbara.” You can do this by

Encrypt a String Easily

This quick and dirty encryption/decryption function takes whatever string you pass it, assigns it to a byte array, Xor’s each byte by a constant, then returns the string. The offsetting

Create a Remote Object Without Extending UnicastRemoteObject

When using Java’s Remote Method Invocation (RMI), you may have defined a server class that extends java.rmi.server.UnicastRemoteObject. Extending UnicastRemoteObject makes your class capable of handling incoming calls, and is acceptable

Avoid Gigantic Classes

Several small and specialized classes are preferred to a single bulky class that contains hundreds of member data members and member functions. More than once I’ve seen programmers extending a

Specifying Position When Adding Components

The java.awt.Container class provides a number of different overloaded versions of the add() method which are used to add components to the container. The integer value specified with the add(Component,

Keep Indexes Separate From Data

You can boost your performance greatly by separating indexes and data onto different physical disks, which allows both the index and data to be accessed at the same time. However,

Counting the Occurrences of a Substring

VB6 has introduced the Replace function, which replaces all occurrences of a substring with another substring. Although this function is useful in itself, you can also use it in unorthodox

Maximum number of controls on a form

Question: VB limits the number of controls on a form to 255. How do you get around this without dynamically creating and displaying them or frames that contain them? Basically,

Saving VB 6 Files for VB 5

Question: The computer lab where I’m taking a course has Visual Basic 6.0 now. Is there some way to save a VB 6.0 project so that it will be compatible

Unloading Application from Memory

Question: I have written an application that uses both DAO and OLE calls. This is a form-based application that sits on top of a CAD package. Sometimes when a user

Menu Security

Question: I am building a security program for a high school in my area. I need a way to allow the teacher to select menus in programs she does not