Microsoft in their invariable wisdom somehow chose to make the manual DRAG function operate rather counter-intuitively. That is, when an item is dropped, the Mouse_Up function for the initiating subroutine is NOT called! This makes it very difficult to detect unsuccessful drops. Detecting an unsuccessful drop can be of importance when you need to update … Continue reading Detecting End of Drag & Drops Sequences
Category: VB
Checksum Calculation
The CheckSum32 function I propose calculates the 32 bits checksum of a string, using a currency variable to avoid overflow errors.Function CheckSum32(A$) As Long'Calculates the 32bits checksum of a stringConst MAXULONG = 4294967295# 'Max unsigned long integerConst MAXLONG = 2147483647 'Max signed long integerDim Sum As Currency 'Currency variable type to avoid overflowDim i As … Continue reading Checksum Calculation
Changing The Control Box Menu
You can turn off the minimize and maximize menu options by changing properties, but what if you're doing something critical in your VB program that should not be interrupted and you need to remove the "close" option? Make the following declaresDeclare Function GetSystemMenu Lib "User" (ByVal hWnd As Integer, ByVal bRevert As Integer) As IntegerDeclare … Continue reading Changing The Control Box Menu
How To Check An Access Database For Errors
Also, if data is entered into a database that has errors, that data (and more) might be loss forever. Below is a Function that can be used every time a program using an Access database is loaded. This code will not catch 100% of the errors -- I have yet to discover any methods that … Continue reading How To Check An Access Database For Errors
Restart/ Exit Windows
DeclareDeclare Function ExitWindows Lib "User" (ByVal RestartCode As Long, _ ByVal DOSReturnCode As Integer) As Integer CodeSub ExitWin (ByVal nExitOption As Integer) Dim n As Integer n = MsgBox("Do you really want to exit Windows?", 36, "Exiting") If n = 7 Then Exit Sub 'User chose NO Select Case nExitOption Case 1 … Continue reading Restart/ Exit Windows
Testing For Non-Null Strings
Some might test for Null by usingIf sSomeString <> "" Then orIf Len(sSomeString) = 0 Then While these might work, it’s 50% faster to useIf IsNull(sSomeString) Then Check out the other "Is" operators, IsDate, IsEmpty and IsNumeric. Use the correct operator for the job you have to do. This tip is reprinted from the … Continue reading Testing For Non-Null Strings
Tile A Bitmap Across A Form
BitBlt API definitions lFrmHwnd - window handle of the form iCol - pixel column iRow - pixel row iPicWidth - width of picture control iPicHeight - height of picture control lPicHwnd - window handle of the picture control 0, 0 - X and Y coordinates to start in upper left corner of the form SRCCOPY … Continue reading Tile A Bitmap Across A Form
VBCE: The EmpFile Utility, A Hidden Gem!
This file is in the Windows NT directory for the emulator, not in the emulator file object store. The empfile utility allows you to do several really neat things: Synchronize a tree with the object store Copy a file on the PC to a directory in the emulators file object store Copy a file … Continue reading VBCE: The EmpFile Utility, A Hidden Gem!
Verify Users Log-in Password
This is not very secure... so we need to verify that the user sending the message is the one who logged into Win95 or WinNT. I searched and searched on how to do this, with no luck. After posting this message on a new group, I was sent the answer and it's surprising easy! It's … Continue reading Verify Users Log-in Password
Visual Basic 5.0 Runtime Files
Below is a table that list the minimum files required for VB5 programs to operate correctly. You will need to add to this list if you use any add-on components, DLL's, database drivers etc. As you can see from the list, there are many OLE files required. I've also read many messages that stated "why … Continue reading Visual Basic 5.0 Runtime Files

You must be logged in to post a comment.