October 23, 2002

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


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

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

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

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

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.