October 23, 2002

Slip Sliding Away: Build an HTML Slider Control

lease fill in this form. Those five words make anyone’s heart sink. Filling in forms is rarely a delight, and Web forms are no exception. The more user-friendly you can make your forms, the less of a burden it causes users to fill out?and the more likely they are to

RunningAsExe – Determine whether the code is running in an EXE or DLL

‘ Return True if the application is running as an EXE’ Return False if the application is running as a DLLFunction RunningAsExe() As Boolean ‘ get the codebase of the running assembly Dim codeBase As String = Reflection.Assembly.GetExecutingAssembly.CodeBase ‘ extract the extension Dim ext As String = System.IO.Path.GetExtension(codeBase) ‘ return

Dealing with DllImport

Part 1: Although the .NET framework encapsulates a large portion of the Win32 API, it’s sometimes still necessary to call the API from your managed code using the DllImport attribute?and that can get complicated. In Part 1 of this two-part series, Martin Heller explores how to use the DllImport attribute


You can use the technique for an “undo” menu/toolbar option. Use a collection instead of a listbox to reduce overhead. Support for both LIFO and FIFO is also included: Public Queue As New CollectionPublic Const Q_LIFO = 0Public Const Q_FIFO = 1 Public Sub Enqueue(QueueItem As Variant) Queue.Add QueueItemEnd Sub

Find the Cause of Query Malfunctions

This tip is for SQL Server 6.5 and up. When debugging a SELECT query, add an absolute true condition as the first condition of the WHERE clause: SELECT au_lname, au_fnameFROM authorsWHERE 1=1 –absolute true condition and state = ‘CA’ and contract = 1 That way, you can comment out one

Get Dynamic Array Information

Use the GetSafeArrayInfo function to rip the lid off a SAFEARRAY. It allows the caller to identify the number of dimensions and number of elements for each dimension (among other things). Element information for each dimension is stored in a one-based subarray of SAFEARRAYBOUND structures (rgsabound): Public Type SAFEARRAYBOUND ‘

Return File Version Info

To use the FileSystemObject, you need to reference the Microsoft Scripting Runtime: Public Function GetExecutableFileVersion(ByVal _ Filename As String) As String Dim FileObj As Scripting.FileSystemObject ‘ Create Object Set FileObj = New Scripting.FileSystemObject If FileObj.FileExists(Filename) Then GetExecutableFileVersion = _ FileObj.GetFileVersion(Filename) End If ‘ Free Object Set FileObj = NothingEnd Function

Let MTS Handle Transaction Management

When you call a stored procedure in SQL Server that performs data manipulation on the database from a Microsoft Transaction Server (MTS) transaction, let MTS handle all the transaction management. Don

No more posts to show