May 5, 1999

Evaluate the integer equal or higher than a given value

The VBA language offers the Int() function, which returns the integer equal or lower than a given value, but lacks a similar function that returns the integer equal or higher than a given value. You can remedy with the following function: ‘ Returns the integer equal or higher than its

Let the user build a connection string

You can programmatically display the standard DataLink property dialog box to let the end user manually build a connection string, that you can later assign to the ConnectionString of an ADO Connection object. To do so you must add a reference to the Microsoft OLE DB Service Component 1.0 Type

Don’t hard-code font names and size

Unless you have good reason to do otherwise, you should always use standard fonts in your programs, because this ensures that your application will work on every Windows system.If you want to use non-standard fonts, you should at least adopt the following guidelines:Assign the font to form and controls through

Undocumented behavior of the CInt() function

The CInt() function rounds to the nearest integer value. In other words, CInt(2.4) returns 2, and CInt(2.6) returns 3. This function exhibits an under-documented behavior when the fractional part is equal to 0.5. In this case, this function rounds down if the integer portion of the argument is even, but

Move Animated GIFs Across a Web Page

Question: I’m trying to make an animated GIF move across a Web page, but the animation freezes in both Internet Explorer 4 and Netscape Navigator 4. I tried to do this with an applet instead of an animated GIF and it works, but the color that I have made transparent

Avoid Integer Overflow

When working with integer expressions there is often the risk of raising the “Overflow” error. More specifically, there can be two occasions when this frequently occurs:When you multiply or add Integer values and the result exceeds 32,767.When you create generic string routines that iterate on each character of the string,

ProgIDToCLSID – Convert a ProgID into a CLSID

Private Declare Function CLSIDFromProgID Lib “ole32.dll” (ByVal lpszProgID As _ Long, pCLSID As Any) As LongPrivate Declare Function StringFromCLSID Lib “ole32.dll” (pCLSID As Any, _ lpszProgID As Long) As LongPrivate Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, source As Any, ByVal bytes As Long)Private Declare Sub

CLSIDToProgID – Convert a CLSID into a ProgID

Private Declare Function ProgIDFromCLSID Lib “ole32.dll” (pCLSID As Any, _ lpszProgID As Long) As LongPrivate Declare Function CLSIDFromString Lib “ole32.dll” (ByVal lpszProgID As _ Long, pCLSID As Any) As LongPrivate Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, source As Any, ByVal bytes As Long)’ Convert a

Fly the Flag

The clock applet that comes with Microsoft Plus! has an interesting feature: Its window is round instead of rectangular. Surprisingly, giving your form an odd shape is easy. Add this code to a new form to give your window the shape of the Microsoft Windows logo: Private Type RECT Left

No more posts to show