The Latest

DevX

The “Assume No Aliasing” compiler option

A procedure is said to contain aliased values if it can refer to the same memory addresses in two or more distinct ways. A typical example is the following procedure:

DevX

Vector vs. Array–the Best of Both Worlds

It’s often pointed out that the Vector class is expensive to use because all of the methods are synchronized. Java 2 has the LinkedList class, which can serve the same

DevX

Modifying Layout on Multiple Platforms

You can use the Toolkit’s getScreenSize().width to recompute the size of a component at run time. For example, if you have a Frame that is supposed to have the screen’s

DevX

Using NULL in a Query’s Where Clause

While comparing a field to NULL, a SQL query should use the IS operator in place of the “=” operator. The reason is that if the ANSI_NULLS option is On

DevX

The Order of Destructors’ Call

An object’s destructor invokes the destructors of its direct base classes and member objects. The invocation occurs in the reverse order of the construction of the subobjects. Note, however, that

DevX

Use Namespaces to Facilitate Software Version Control

Successful software projects do not end with the product’s rollout. In most projects, new versions that are based on their predecessors are periodically released. Moreover, previous versions have to be

DevX

Be Careful With Initializers in Constructors

You should use caution when automatically initializing class variables. In this example, C1 calls setVal() in its constructor, and C2, a subclass of C1, overrides the method to set a

DevX

Working With Collections

When working with collections, use an error handler to easily determine if a given key exists in the collection. If you try to access an item from a collection where

DevX

N.T. 4 Conversion

Question: Is there a painless way of converting a Novell 4.1 server to N.T. 4 without just performing a total rebuild? There are no applications running from the server but

DevX

OLE Commands for Powerbuilder to Word/Excel

Question: I was wondering if there is a list available somewhere of all the commands with their syntax for OLE? I want to manipulate Word and Excel from inside Powerbuilder

DevX

Accessing 2 or More Databases

Question: How do I access more than one database (e.g., Oracle and Access) via a Powerbuilder application? I currently have ODBC drivers for both databases, but cannot access the required

DevX

NT Scheduling

Question: How do I schedule to run my Exe automatically?When I schedule it, the exe does not run. Answer: First, for Command Scheduler to work consistently, the Schedule service must

DevX

Counting Time

Question: How can I count how long an application is used? Answer: You can use two time variables for this. Use the first variable to record the start time, then

DevX

PowerBuilder 6.5 and MS Word 97 Example

Question: Do you have any examples of calling MS Word Visual Basic to open, modify, print and close a document (i.e., calling macros, inserting tables)? Answer: Here is an example

DevX

Running NT Server 4.0 with Service Pack 4

Question: I have a question about running NT Server 4.0 with Service Pack 4. On start-up, I’m getting an error in my event log: Source: Server Control Manager, EventID 7023,

DevX

Use the Intern Method to Achieve String Equality

String comparison doesn’t work for variables. In fact, only variables referencing the same string will work. The String class has an intern method, which lets you compare two variables. This

DevX

Compound member attributes

The Procedure Attributes dialog includes a Procedure ID combo box, that lets you associate a particular ID to a given member of the class. You usually use this combo to

DevX

Retrieve the currency symbol

It is very simple to retrieve the correct currency symbol, using just plain VBA statements: currSymbol = Trim$(Replace(FormatCurrency(0,0), “0”, “”)) If you can also determine if the symbol precedes or

DevX

Never mix SingleUse and MultiUse classes

ActiveX components written in VB can contain both SingleUse and MultiUse classes at the same time. It usually isn’t a good idea to use both types of classes in the

DevX

Caveats of the CopyMemory API function

Here’s the correct declaration of the CopyMemory API function, which is so useful whenever you want to move a block of bytes between two memory locations: Declare Sub CopyMemory Lib

DevX

Always ensure that a printer is installed

Many developers incorrectly assume that a printer is always installed on their customers’ machines, and therefore omit to check that this is actually the case. The following function, deceiptively trivial,

DevX

Retrieving Bitmap properties

The Picture box control does not directly expose any property that returns information on the bitmap currently loaded. You can retrieve this information by calling the GetObject API function, passing

DevX

ShowPrinterProperties – Display printer’s Properties dialog

Private Declare Function PrinterProperties Lib “winspool.drv” (ByVal hwnd As _ Long, ByVal hPrinter As Long) As LongPrivate Declare Function OpenPrinter Lib “winspool.drv” Alias “OpenPrinterA” _ (ByVal pPrinterName As String, phPrinter