June 19, 1999

ForceTextBoxNumeric – Create a numeric Textbox

Private Declare Function GetWindowLong Lib “user32” Alias “GetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib “user32” Alias “SetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long’ Force a TextBox control to accept only numeric digits’

ForceTextBoxCase – Set a textbox’s upper/lowercase style

Private Declare Function GetWindowLong Lib “user32” Alias “GetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib “user32” Alias “SetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long’ Change the style of a textbox so that it

GetTempFile – Create a temporary file

Private Declare Function GetTempFileName Lib “Kernel32” Alias _ “GetTempFileNameA” (ByVal lpszPath As String, _ ByVal lpPrefixString As String, ByVal wUnique As Long, _ ByVal lpTempFileName As String) As LongPrivate Declare Function GetTempPath Lib “Kernel32” Alias “GetTempPathA” (ByVal _ nBufferLength As Long, ByVal lpBuffer As String) As Long’ Creates a temporary

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 of the ObjPtr functionFunction ObjFromPtr(ByVal pObj As Long) As Object Dim obj As Object ‘ force the value of the

Optimize Your Scripts in DHTML Using the DEFER Attribute

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 or later that the SCRIPT tag contains no immediately executing code that impacts the document before the load event fires.

Passing Named Arguments to Java Programs

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 into a GamePlayer class: java -Duser=champ -Dlevel=expert GamePlayer Classes will use them as follows: public class GamePlayer { public static

Declare Non-Template Functions and Classes as Friends of a Template

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 have various types of friendship. First, you can declare ordinary functions and classes as friends of

How to Declare Non-Template Functions and Classes as Friends of a Template

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 have various types of friendship. First, you can declare ordinary functions and classes as friends of

No more posts to show