|
|
|
|
|
|
|
|
SemiCRC - A fast CRC-like algorithm
|
Total Hit (1617) |
«Code LangId=1»
' Evaluate the 16-bit Checksum of an array of bytes
Function SemiCRC(bSource() As Byte) As Long
Dim lngCRC As Long
Dim lngTemp As Long
Dim lngSize As Long
Dim I As Long
Const divisor As Long = 32768
lngSize = UBound(bSource())
For I = 0 T
....Read More |
Rating
|
|
|
|
BitCount - The number of "1" bits in a number
|
Total Hit (2744) |
«Code LangId=1»
' The number of 1's in a binary number
'
' This routine is based on the following property
' of binary numbers: n And (n-1) always clears the
' least significant "1" bit in the number
Function BitCount (ByVal number As Long) As Integer
Do While number
number =
....Read More |
Rating
|
|
|
Improve availability by running a COM+ app as an NT service
|
Total Hit (1821) |
COM+ 1.5 has the ability to run any server application as a NT service, so that the application is up and running when the machine reboots, before any client makes the first requests. This improves the response time of the COM+ application. Besides, running a COM+ app as a service means that it can
....Read More |
Rating
|
|
|
Control the mouse speed under Windows 98 / 2000
|
Total Hit (3647) |
Under Windows 98 and 2000 you can control the speed of the mouse. The mouse speed determines how far the pointer will move based on the distance the mouse moves. The pvParam parameter must point to an integer that receives a value which ranges between 1 (slowest) and 20 (fastest). A value of 10 is t
....Read More |
Rating
|
|
|
Quick Property Edits
|
Total Hit (2247) |
When you are placing controls on a form at design time and wish to edit one of its properties, the quickest way to switch to the Property window is pressing the Ctrl+Shift+key combination, where key is the first letter in the property name. For instance, to quickly modify the Caption property you si
....Read More |
Rating
|
|
|
Faster string appending with Mid$ command
|
Total Hit (3285) |
As you probably know, the "&" operator is rather slow, especially with long strings. When you have to repeatedly append chucks of characters to the same variable, you can speed up your code using a simple trick based on the Mid$ command. The idea is that you pre-allocate a buffer long enough to acco
....Read More |
Rating
|
|
|
Write concise code with the Choose function
|
Total Hit (2989) |
The Choose function lets you often make more concise, albeit not faster, code, because it lets you replace a lengthy Select Case block. For example, the following code:
«Code LangId=1»
Select Case index
Case 1
result = 100
Case 2
result = 250
Case 3
resu
....Read More |
Rating
|
|
|
IsMissing returns False with non-Variant arguments
|
Total Hit (3685) |
Every now and then I forget that the IsMissing function always returns False when the argument is not a Variant value. This happens because IsMissing does nothing more than converting its argument to Variant and testing for a special VarType value. For this reason, the following code is a symptom of
....Read More |
Rating
|
|
|
How to extract various parts of URL using UrlGetPart API ?
|
Total Hit (5112) |
Have you ever tried to extract various parts of URL....? If yes then you know how tedious it is. But in fact is very simple if you use API UrlGetPart.
Here is a simple example to use this API.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Place the following code in form1
....Read More |
Rating
|
|
|
How to renew/release DHCP lease of a selected interface ?
|
Total Hit (6114) |
This article will show you how to use IP Helper APIs GetAdaptersInfo, GetInterfaceInfo, IPReleaseAddress and IPRenewAddress to list all available IPs and perform renew/release operation on a selected IP.
Before we see actual code lets quickly check the description of each API.
«b»GetAdaptersIn
....Read More |
Rating
|
|
|
Printing using GDI printing APIs
|
Total Hit (3795) |
This sample code will show you how to perform basic print operations using GDI print APIs
- Create a standard exe project
- Add one command button control on the form1
- Add the following code in form1
«code LangId=1»Option Explicit
Private Declare Function StartDoc Lib "gdi32" Alias _
....Read More |
Rating
|
|
|
Tutorial on Working with File I/O in VB6
|
Total Hit (4426) |
«b»Reading from a file«/b»
«code LangId=1»Public Function ReadFromFile(FilePath As String) As String
Dim iFile As Integer
Dim s As String
'//Check for File Path
If Dir(FilePath) = "" Then Exit Function
On Error GoTo ErrorHandler:
iFile = FreeFile
Open FilePa
....Read More |
Rating
|
|
|
How to obtain the description of the System's Processor
|
Total Hit (4214) |
API Declarations
«Code LangId=1» 'API Structures
Public Type SYSTEM_INFO
wProcessorArchitecture As Integer
wReserved As Integer
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOfP
....Read More |
Rating
|
|
|
Writing Your First Speech Recognition Program by John T. Yung
|
Total Hit (1972) |
I recently came upon a project where a program can take in voice commands and perform tasks like opening a program or a file in Windows without any mouse or keyboard input. At first, I thought that was some fancy coding stuff going on that was out of my league. Well guess what, on a closer investiga
....Read More |
Rating
|
|
|
CSocket class - replacement for the MS Winsock Control
|
Total Hit (5206) |
This is an attempt to simulate functionality and behavior of the MS Winsock ActiveX Control. Why do I call it "an attempt"? Because I don't know what exactly is going on inside that control. I can suppose which Winsock API functions are called by the control's methods but I don't know a lot of other
....Read More |
Rating
|
|
|
Enumerating Windows Using Callbacks
|
Total Hit (1330) |
Windows offers VB programmers the 'EnumXXX' APIs providing callback data for specific tasks.
This page demonstrates using the EnumWindows() API to enumerate all windows on the system, and populate a listbox with their class name, hwnd and window text if available.
....Read More |
Rating
|
|
|
AVI Frame Extractor
|
Total Hit (2914) |
The AVI Frame Extractor code provided here allows you to extract and display individual frames from AVIs. This can be useful if you're trying to create a derivative of an existing AVI as you can extract each of the frames and either edit them in a painting package or write a program to do it. There'
....Read More |
Rating
|
|
|
Hierarchy Selector Control
|
Total Hit (1014) |
The Hierarchy Selector control is an enhanced COMCTL32.OCX TreeView control which allows you to easily create option dialogs like the Win98 Folder Options dialog and the Internet Explorer Advanced option dialog. In addition to this, it also provides methods which allow you display a hierarchy of opt
....Read More |
Rating
|
|
|
vbAccelerator MDITabs Control
|
Total Hit (2453) |
Over the years, Microsoft applications have been moving away from the old Multiple Document Interface style to a more modern look. This component, provided as a DLL, automatically converts a VB MDI application to one which looks like Visual Studio, with a tab for each window. Tabs can be scrolled an
....Read More |
Rating
|
|
|
S-Grid 2.0 Features
|
Total Hit (2522) |
This article provides a rundown of the new features and updates provided in S-Grid 2.0, and also shows samples of the types of displays that can be set up using the control.
|
Rating
|
|
|
Easy INI File Access
|
Total Hit (1796) |
The cIniFile class is an easy, self-contained way to get complete access to INI files. Although use of INI files is no longer recommended under Windows (you should use the registry instead - see my Registry class for an easy migration from this method of using Ini files to using the registry) they a
....Read More |
Rating
|
|
|