
ObjFromPtr – Return an object from its pointer
Private Declare Sub CopyMemory Lib “Kernel32” Alias “RtlMoveMemory” (dest As _ Any, Source As Any, ByVal bytes As Long)’ Returns an object given its pointer’ This function reverses the effect

Private Declare Sub CopyMemory Lib “Kernel32” Alias “RtlMoveMemory” (dest As _ Any, Source As Any, ByVal bytes As Long)’ Returns an object given its pointer’ This function reverses the effect

DEFER is a relatively obscure attribute of the SCRIPT element, but if you want to enhance performance when authoring scripts, you can use it to indicate to Internet Explorer 4

Here’s an example of a better way to pass arguments to main() methods of Java classes than using String[] args. First, pass two named parameters, user and level, that come

A friend of a class template can be a function template or class template, a specialization of a function template or class template, or an ordinary (non-template) function or class.

You can declare a template specialization as a friend of a class template. In this example, the class template Vector declares the specialization C

A friend of a class template can be a function template or class template, a specialization of a function template or class template, or an ordinary (non-template) function or class.

A class template can be a friend of another class template. For example: template class D{/* Related Posts Finding the Available Drive Types in the SystemCalculate the Number of Days

The New keyword in VB is used to create a new instance of a class as an object for use within the current application. When used in a component within

With the introduction of the Boolean data type in VB4, you might be tempted to convert it to a numeric value using the Val function for storage in a database

When dealing with numerics and strings, be advised of a couple “gotchas.” The Val() function isn’t internationally aware and will cause problems if you have users overseas. But you can’t

Instead of using an If construct to set a Boolean variable, you can assign a Boolean variable to the result of any logical comparison. For example, instead of this code:

Use the Count property to determine exactly how many controls are loaded. You can also use the For Each loop to perform code on each control. For instance, if you

Don’t overlook the UNION keyword in SQL as a way to simplify selections from multiple tables. For instance, to select the customer with the highest sales from three tables with

Want to see a list of the developers who worked on VB5 and VB6? Try this: From VB’s View menu, select Toolbars, then Customize…. In the resulting dialog, click on

Don’t put rules for validating text values or formats in the KeyPress event-use the Change event instead. If you “paste” into a text box, the KeyPress event isn’t fired and

You probably already know that if you select multiple controls on a form you can use the Property Window to change one of their common property in one single operation.

You can query SQL Server system tables to retrieve the list of all the stored procedure that are available for the end user and applications. The following routine extract their

When you write lengthy procedures, it is a good habit to change the mouse cursor to an hourglass, and restore it to the original shape when the procedure exits. However,

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:

When you have a long HTML file to edit, scrolling up and down to your working areas can be a real pain. Fortunately, you can apply bookmarks to points in

Components that are implemented as executable files (EXE files) cannot execute in the Microsoft Transaction Server (MTS) runtime environment. The components need to be DLLs that are registered in MTS.

A typical operation in DHTML is to iterate through a collection of objects. Let’s say you’re writing an HTML application that indexes content. Your task is to collect all the

SQL Server 6.5 has an APP_NAME() function which returns the program name for the current session. This function is useful for tracking which client applications are running processes in SQL

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

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

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

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

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

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

An implicitly-declared default constructor has an exception specification. The exception specification contains all the exceptions of every other special member functions (for example, the constructors of base class and embedded