August 19, 2000

A guerrilla course on COM(+) security

Introduction Most developers hate to deal with securityissues; that’s why the security-design subject is, most of the time, left out from the “typical developer” MSDN surfing and the application prototypes you show your boss.From time to time, unfortunately,  your prototype must turn into a real-world application to beused into a

ComboBoxExtendedMatching – Extended Matching mode for ComboBox controls

‘ Enable extended matching to any type combobox control” Extended matching means that as soon as you type in the edit area’ of the ComboBox control, the routine searches for a partial match ‘ in the list area and highlights the characters left to be typed.” To enable this capability

ListboxToArray – Retrieve an array of strings from a ListBox or ComboBox control

‘ Returns a string array containing all the elements’ of the specifid ListBox or ComboBox control” Example:’ Dim strArray() As String’ strArray = ListBoxToArray(Combo1)Public Function ListBoxToArray(ctrl As Control) As String() Dim index As Long ‘ if the control isn’t a ListBox, ComboBox or one of their ‘ variant, the following

DragControl – Drag any control using the mouse

Private Type POINTAPI X As Long Y As LongEnd TypePrivate Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePrivate Declare Function ClipCursor Lib “user32” (lpRect As RECT) As LongPrivate Declare Function ClipCursorByNum Lib “user32” Alias “ClipCursor” (ByVal _ lpRect As Long) As LongPrivate Declare

ArrayToListbox – Add an array of strings to a ListBox or ComboBox

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Declare Function LockWindowUpdate Lib “user32” Alias “LockWindowUpdate” _ (ByVal hwndLock As Long) As LongPrivate Const LB_ADDSTRING = &H180Private Const LB_RESETCONTENT = &H184Private Const

MoveListboxItem – Move an item of a ListBox to another position

‘ Move an item of a listbox to another index” If FROMINDEX = -1 then it moves the current highlighted itemSub MoveListboxItem(ctrl As ListBox, ByVal FromIndex As Long, _ ByVal ToIndex As Long) Dim sText As String, lItemData As Long ‘ provide a default If FromIndex < 0 Then FromIndex

ListBoxTooltip – A class for displaying items’ values in a tooltip

‘ — The ListBoxTooltip class” Usage in the client form:” Dim lstTT As New ListBoxTooltip” Private Sub Form_Load()’ Set lstTT.ListBox = List1′ End Sub’ Private Sub Form_Unload(Cancel As Integer)’ Set lstTT.ListBox = Nothing’ End SubPublic WithEvents ListBox As ListBoxPrivate Sub ListBox_MouseMove(Button As Integer, Shift As Integer, X As Single, _

The Difference Between SOUNDEX and DIFFERENCE in SQL Server 7.0

SQL Server’s SOUNDEX and DIFFERENCE functions can be used to performqueries based on phonetic comparisons. Although they may share similarpurposes, they have some differences. SOUNDEX takes a character string and modifies it to a four-digit code for use in query comparisons. Characters that aren’t alphabetic end the comparison, and vowels

Repositioning a File Pointer

The fseek() function provides random file access. It’s declared in as follows: int fseek(FILE *fstream, int offset, int whence); The function sets the file pointer associated with fstream to a new position that is offsetbytes from the location specified by whence. The argument whence can have one of these values:

No more posts to show