|
Send Email using CDOSYS.
|
Total Hit (4127) |
This code snippet will show you how to send SMTP email using CDOSYS. CDONTS was old library for Win NT which is discontinued in XP and 2000. CDOSYS is more flexible than CDONTS. The follwoing code will work with VB6 and VB.net without any modification.
From this code you will learn
1) How to a
....Read More |
Rating
|
|
|
|
|
|
|
|
Split2 - A Split variant that parses multiple lines of text
|
Total Hit (1708) |
«Code LangId=1»
' A Split variant that parses a string that contains
' row and column separators, and returns a 2-dimensional array
'
' the result String array has a number of columns equal
' to the highest number of fields in individual text lines
Function Split2(ByVal Text As String, Opti
....Read More |
Rating
|
|
|
BitCount - The number of "1" bits in a number
|
Total Hit (2628) |
«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 (1747) |
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 (3518) |
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
|
|
|
Check a GUID
|
Total Hit (2887) |
The following routine quickly check that a string contains a valid GUID. Of course, it doesn't check that the GUID refers to a valid entity, but at least it lets you quickly reject invalid values:
«Code LangId=1»
Function CheckGUID(Value As String) As Boolean
Const PatternGUID = "{#######
....Read More |
Rating
|
|
|
Topmost windows
|
Total Hit (2023) |
This is an evergreen, but it's still popular. It is very easy to create a window that always stays on top of the others, thanks to the SetWindowPos API function. Here is a general procedure that can be called to make a form the topmost window and to revert to the normal status. This capability is ex
....Read More |
Rating
|
|
|
Implement a MaxLength property for the ComboBox control
|
Total Hit (2137) |
Unlike the TextBox control, the ComboBox control doesn't expose any MaxLength property, so you have no means of limiting the numbers of characters typed by the end user in the edit area. However you can set this value by sending a CB_LIMITTEXT message to the control, passing the maximum number of ch
....Read More |
Rating
|
|
|
Faster string appending with Mid$ command
|
Total Hit (3151) |
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 (2838) |
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 (3554) |
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 Automate Microsoft Excel from Visual Basic
|
Total Hit (3758) |
There are two ways to control an Automation server: by using either late binding or early binding. With late binding, methods are not bound until run-time and the Automation server is declared as Object. With early binding, your application knows at design-time the exact type of object it will be co
....Read More |
Rating
|
|
|
|
|
Checking for Media Availability Using DeviceIoControl
|
Total Hit (1366) |
This is the DeviceIoControl method for determining if a given drive has media present. The nice thing about this call is that it does not need to spin up the disk - the call returns instantly. The only lag might be if a new disk was inserted and the call was made while the OS was spinning up the dri
....Read More |
Rating
|
|
|
Enumerating Share Connection Information
|
Total Hit (1461) |
The WNetEnumResource API continues enumeration of network resources on the local computer that was started by a call to the WNetOpenEnum API function. It will not retrieve the shares in use on remote machines. The illustration shows the function enumerating all network resources on my development ne
....Read More |
Rating
|
|
|
Creating a Ledger-Style Listview Report Background
|
Total Hit (1112) |
This page takes a different approach based on the Picture property of the VB5 and VB6 listviews. With this demo, picture box properties are set to match the size and font of the listview. The demo then draws two filled rectangles inside the picture box corresponding to ledger colours specified, and,
....Read More |
Rating
|
|
|
Changing the Display Resolution from Visual Basic
|
Total Hit (1156) |
This routine, like the ListView method in Enumerating the Available Display Resolutions, uses Windows' EnumDisplaySettings API to retrieve all the available screen resolutions supported by the display. Here, the results are used to create a "QuickRes-style menu", replete with the option of displayin
....Read More |
Rating
|
|
|
|
|
Rank Filters
|
Total Hit (736) |
This is a supporting note describing the Rank filter provided in the vbAccelerator Image Processor. Rank filters can either be linear, yielding a softening effect, or non-linear, giving an impressionistic effects to a images.
|
Rating
|
|
|
vbAccelerator Toolbar and CoolMenu Control v3.5
|
Total Hit (2188) |
This control allows you to create modern UIs like Internet Explorer or Word with full colour-depth toolbars, CoolMenus, resizable and movable toolbar bands, controls in the toolbar and much more. It works with standard forms and MDI forms and also allows you to create Outlook-style MDI applications
....Read More |
Rating
|
|
|
Easy INI File Access
|
Total Hit (1710) |
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
|
|
|
Writing Your First Speech Recognition Program by John T. Yung
|
Total Hit (1860) |
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 (5026) |
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
|
|