devxlogo

The Latest

Let the User Control Long Operations

To allow the user to control long operations, use a single CommandButton to control starting and stopping a looping process: Dim Running As BooleanPrivate Sub CmdStartStop_Click() If Running Then ‘

Pass Parameters to User Dialogs

It’s fairly common practice to add buttons to your date and numeric fields to allow users to select and display a popup calendar or calculator. However, to display a calculator

A Better Way to Swap Two Integer Variables

The algorithm shown in the tip, “Swap Values Using Only Two Variables” [“101 Tech Tips for VB Developers, Supplement to the February 1997 issue of VBPJ, page 25], crashes not

Use Arrays, Not Collections

Arrays take less memory and are faster than collections. If you don’t need to use a collection’s keyed lookup, easy extensibility, and other features, use an array instead. Related Posts

Draw Complex Shapes

You can create complex shapes easily if you have a copy of Microsoft PowerPoint, CorelDraw, or any other graphics editor. Using your graphic editor’s drawing tools, draw the shape you

Don’t Show me the Hourglass

When creating applications, especially on an enterprise scale, don’t create them so that they run start to finish, tying up the user’s PC needlessly. If all you need is two

BDE Configuration

Question: I’ve developed a database using Microsoft Access, exporting the files to a Paradox 5 format. Now, the application I’ve developed that utilizes this database is currently running on two

Putting Hints in Status Bar

Question: I am using the application.onhint example from the Delphi help files to put all hints in my status bar. It works on all but one form. I’m using the

JavaScript Compatibility

Question: As a Web designer, one of my biggest struggles is JavaScript compatibility with previous browser versions (such as IE3, IE4, N2, N3, and N4). Is there a way I

Related Database

Question: I’m trying to make outer join by the query builder in Delphi 2.0 but the only active option is inner join. I want to use left outer join and

Running an EXE file via a Delphi App

Question: I want to be able to run an EXE file on a button click in one of my Delphi applications. Is it possible to do this? Where do I

Component Events

Question: How can I add a new event to an existing component (for example, OnScroll to a TTreeView) without building a new ComponentClass? Answer: You can replace existing event handlers

Increase Query Performance

Question: I have a form that uses one data source and one query component. The data set of the data source is the query. Depending on the process, I assign

Find Trouble Spots

Implement a low-tech trace of your application by writing a message whenever your code enters and exits a subroutine. This can help you locate elusive bugs, because you can turn

Determine Next/Previous Weekday

This function returns week identifier information, such as Week Beginning/Ending date, and makes it more generic to return a date of any previous or following weekday. You can use this

Let the Editor Check Your Spelling

To make certain that you declared your variables, place Option Explicit in your Declarations section. Using a mixture of upper and lower case in variable names, you can easily verify

Create DLL from PB

Question: I have an application with a lot of business logic in nonvisual objects that I’d like to deploy as DLLs callable as standard windows DLLs from applications written in

DCOM and Win NT Workstation

Question: How many DCOM connections can I have on a Windows NT Workstation? (Does it have a limit of 10, like in shares?) How is performance affected when 20 users

DBENGINE – 16 bit

Question: I need to use the BDE in a Windows 3.11 environment. My Delphi 1 system does not include BDEINST material, although the help files refer to it. How can

Simulate Win95 Taskbar Within Your App

The Windows 95 taskbar (with the Auto Hide check box set) is quite attractive and provides a compact, nonintrusive way to access and organize information. You can easily simulate this

VB Version IsDate Differences

Under VB3, IsDate returns True only if the string corresponds to the date format indicated by the “Regional” or “International” settings in the Control Panel. Under VB4 and VB5, however,

Assert() is Dangerous

The standard assert() macro tests its argument. If the result evaluates to 0, the standard abort() routine is called. Back in C heyday, it was a very useful debugging tool

How to Avoid Code Bloat When Using Templates

If you are using templates in your code, you are probably aware of their invaluable advantages. However, templates can cause a code bloat: The compiler reduplicates the template’s body for

Explicit Template Instantiation

In large projects, where hundreds of source files have to be compiled on every build, the long compilation time can be reduced significantly if templates are explicitly instantiated all at

The Type of a Class Template

A template name is not a type. When you need a template functioning as a full type (for example: to serve as a base class or as a function argument),

Template Specialization

Templates are generic due to their type unawareness. However, there are cases where you need a special behavior for a specific type. C++ supports these cases by means of template