The Latest

DevX - Software Development Resource

Use the Continuation Marker Before a Line Break

C++ statements can be broken into more than a single line. However, you cannot break literal strings such as printf() format string, macros, or literals. When you need a long

DevX - Software Development Resource

Lingering on Sockets

Java’s Socket class gives you control over how a socket handles queued data when it closes. This linger-on-close option allows you to dictate whether you want the socket to send

DevX - Software Development Resource

Quirks of the Dir$ Function

If you use the intrinsic VB Dir$ function to check for the existence of a certain file, then subsequently try to remove the directory where the file is found using

DevX - Software Development Resource

Keep Menu Items in Sync With Enabled Property

How many times have you had to control the same processes with both command buttons and corresponding menus? I expect you’d say “many,” which means you’ve had to set the

DevX - Software Development Resource

Determine Which Scrollbars are Visible

Sometimes, it’s useful to know whether a control is displaying vertical scrollbars, horizontal scrollbars, both horizontal and vertical, or no scrollbars at all. For instance, when determining the amount of

DevX - Software Development Resource

View Selected Text From the Beginning

Most professional and commercial applications exhibit a specific behavior when using dialog boxes with text fields: When you tab to an input field, or hot-key (using some ALT-key combination), you

DevX - Software Development Resource

Enumerate Your Errors

To keep a list of available error codes in your components, declare a private enumeration: Private Enum Errors InvalidUserID = vbObjectError + 513 InvalidPassword SearchNotFoundEnd Enum Setting the first value

DevX - Software Development Resource

Allow Multiple Winsock Connections to One Server

The Winsock control allows you to make only one connection between two computers. However, you can create multiple connections (many computers to one) by creating multiple instances of the Winsock

DevX - Software Development Resource

Using a Non-Databound Grid

Question: I am creating an Active Server Pages (ASP) application using Visual InterDev and I need to display data in a non-bound data grid. I have read that it is

DevX - Software Development Resource

Quick Timer Control Replacement

Timer controls can be practical when you need to add a small delay in program execution. However, if you need the delay in a class module (instead of on a

DevX - Software Development Resource

Locating the Results Page in Index Server

When you use Index Server and Internet Information Server (IIS), you get a moderately useful search process built into your Web application. However, it isn’t readily apparent where that data

DevX - Software Development Resource

A vector<Base> Should Not Store Derived Objects

A vector stores its elements contiguously in memory (although this is not a requirement in the Standard, in practice, all implementations use contiguous storage). Consequently, each element in a vector

DevX - Software Development Resource

Create Hyperlinks in Perl Using a Regular Expression

When outputting HTML, it’s often handy to be able to turn any URL, such as http://www.whatever.com, into a hyperlink, such as http://www.whatever.com. You can do this with a regular expression

DevX - Software Development Resource

Disable and Enable Trace Output in Your Program

The prominent mechanism used to debug a Java application is to write string messages to System.out. However, this method clutters up the output of the program. In order to turn

DevX - Software Development Resource

The Minimum Requirements for STL Containment

Any object that defines the copy constructor, default constructor, assignment operator and destructor as public members (either explicitly or implicitly) can be stored in STL containers. If you do not

DevX - Software Development Resource

Center Your Windows

By default, instances of Window subclasses such as Frame and Dialog appear at the upper-left corner of the screen when made visible. For a more user-friendly interface, you can center

DevX - Software Development Resource

Draw Frames on Form Without Control

The DrawEdge API provides a convenient way to draw a number of interesting effects. You can change the EDGE_ constants to give different border effects; the BF_ constants determine which

DevX - Software Development Resource

Put Non-Breaking Spaces in Empty HTML Table Cells

The tables that you design so carefully could end up looking odd in Internet Explorer or Netscape Navigator. The trouble is that browsers treat empty table cells differently. For instance,

DevX - Software Development Resource

Running Applications From Your Own

Question: What code do I use for Delphi to run a program and use command line parameters inputted by the user? Answer: This code will allow you to launch other

DevX - Software Development Resource

Exception Handling Misuses

Exceptions can be used as an alternative control structure in addition to for-loops or while-blocks. For example, you can use exceptions to implement a simple application that prompts the user

DevX - Software Development Resource

Timely Capture of Font Metrics

If you extend an AWT class to add text to a GUI component, then you probably need access to the font’s metrics so that you can deduce the amount of

DevX - Software Development Resource

Directing CGI Output to Another Frame

A little-known attribute of the tag is TARGET. This attribute can be used to direct the output of a CGI program to another browser window, or another frame in the

DevX - Software Development Resource

Determining Shift Button State

Question: How can I determine if is down or up while dragging an object within my app? The goal is to detect if something is being copied or moved. Answer:

DevX - Software Development Resource

Developing E-Mail System

Question: I want to develop a free e-mail system similar to what Hotmail and Yahoo offer. I was wondering if you could give me some ideas on how to approach

DevX - Software Development Resource

STL Containers Should Not Hold auto_ptr<> Members

During reallocation, a container re-constructs its elements in a new memory location and destroys the original elements by invoking their destructor. Since the destructor of auto_ptr deletes its bound object,

DevX - Software Development Resource

Using Files as Persistent Flags

In Java, static variables may be used as flags to maintain state between different instantiations of a class (see Tip: “Using Static Variables to Store State Across Instantiations”). However, the

DevX - Software Development Resource

NT as Primary Domain Server

Question: I want to set up my NT Server as my primary domain server. How do I do it? Answer: Unfortunately, the only way I know to convert a current

DevX - Software Development Resource

MTS, ASPs, and State(less) objects

Question: When implementing the Microsoft DNA model, it is suggested to create objects with methods only (no properties) to maintain true stateless objects. If an object will only live for

DevX - Software Development Resource

16 bits vs 32 bits

Question: Can we transfer an application from 32 bits to16 bits (PowerBuilder 5.0) without problems ? Answer: The only thing you will have to check for is API calls. The