|
|
How to read data from Excel file
|
Total Hit (3713) |
Many times we have requirements to load data from CSV file, text file or Excel file...
In this article I will show a sample code which reads a specified rows and columns from excel file.
«code LangId=1»Private Sub Command1_Click()
ImportExcelToSQL "c:\temp\diamond_upload.xls", 0, 20, True
....Read More |
Rating
|
|
|
How to Add/Remove NT user account programatically
|
Total Hit (5627) |
This article will show you use of NetUserAdd and NetUserDel API to add/remove useraccount.
Windows NT and Windows 2000 exposes LanMan 32-bit Application Programming Interfaces (APIs) to provide network services. These APIs are called only from 32-bit programs running on a Windows NT or Windows 20
....Read More |
Rating
|
|
|
Taking advantage of EFS (Encrypted File System) APIs in Win2K/XP
|
Total Hit (5088) |
The Encrypted File System, or EFS, was introduced in version 5 of NTFS to provide an additional level of security for files and directories. It provides cryptographic protection of individual files on NTFS volumes using a public-key system. Typically, the access control to file and directory objects
....Read More |
Rating
|
|
|
Interprocess communication using DDE (Dynamic Data Exchange) - Part2
|
Total Hit (10100) |
In our previous article «b»«a href='CodeDetail.aspx?CodeId=3767'»Interprocess communication using DDE (Dynamic Data Exchange) - Part1«/a»«/b» of this this series we learned about basic concept of DDE and we also saw that how to implement DDE Server using DDEML Apis. Now in this article I will show y
....Read More |
Rating
|
|
|
How To Use High-Level Access Control APIs from Visual Basic
|
Total Hit (4784) |
The Win32 API provides two sets of APIs for working with security descriptors (SDs) and access control lists (ACLs). Low-level as well as high-level access control API sets provide an interface for working with SDs and ACLs. For Microsoft Windows 2000 and MIcrosoft Windows XP, the high-level access
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
MakePath - Create a nested directory
|
Total Hit (1894) |
«Code LangId=1»' create a nested directory
'
' it's similar to MkDir, but it also creates
' all intermediary sub-directories
Sub MakePath(ByVal path As String)
Dim i As Integer, ercode As Long
On Error Resume Next
Do
' get the next path chunk
i = InStr(i
....Read More |
Rating
|
|
|
|
|
Make COM objects in a COM+ application visible to clients
|
Total Hit (1778) |
What I describe for COM+, applies to MTS with some slight differences as well.
Registering COM objects remotely has been quite a pain before MTS showed up (remember the VBR file?). In COM+ it's very easy to do:
1) Right click on the COM+ application and choose export Choose application proxy,
....Read More |
Rating
|
|
|
Correctly restore mouse cursor
|
Total Hit (3408) |
When you write lengthy procedures, it is a good habit to change the mouse cursor to an hourglass, and restore it to the original shape when the procedure exits. However, this cursor tracking may be rather difficult when the procedure has multiple exit points, or when it can exit abruptly because of
....Read More |
Rating
|
|
|
Play an AVI movie
|
Total Hit (5249) |
If you want to play an AVI movie from VB you can use MCI functions. The main MCI function is mciSendString, that sends command strings to the system and execute them:
«Code LangId=1»
Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal _
lpstrCommand As String, ByVal lps
....Read More |
Rating
|
|
|
Incremental searches within list boxes
|
Total Hit (2600) |
The DBList and DBCombo controls expose a MatchEntry property, that - when set to True - permits to perform quick incremental searches by simply typing the searched sequence of characters. If MatchEntry is set to False, any time the user presses a key, the next item that begins with that character be
....Read More |
Rating
|
|
|
Fixed-length strings allocate and deallocate faster
|
Total Hit (2796) |
Fixed-length strings are generally slower than conventional strings, because all VB string functions and operators only recognize conventional strings, thus all fixed-length strings must be transparently converted to and from conventional strings.
However, arrays of fixed-length strings occupy a
....Read More |
Rating
|
|
|
Write concise code with the IIf function
|
Total Hit (2196) |
Use IIf when setting a value based upon an expression. This works only in situations where you have two choices, based upon the result of a Boolean expression.
«Code LangId=1»
'long way
If Var1 > Var2 Then
Var3 = Var1 / Var2
Else
Var3 = Var2 / Var1
End If
'this is more concise
Var
....Read More |
Rating
|
|
|
Customizing the ListView's Appearance via API
|
Total Hit (1683) |
Once again, the SendMessage API, in conjunction with the new extended style flags for the ListView control, provides a means to customize the appearance of the listview common control in a Visual Basic application.
By combining the new LVBKIMAGE structure (Type), and specifying the LVBKIF_SOURCE_U
....Read More |
Rating
|
|
|
How to Add Checkboxes to a ListView
|
Total Hit (1319) |
This page demonstrates adding the ability to have checkmarks to the left of the item icon in report view. Under Win95 the check boxes are not not pretty.
By setting a ListView extended style bit using the API SendMessage with the message LVS_EX_CHECKBOXES, the ListView rows will have a left-most
....Read More |
Rating
|
|
|
Changing Colours of a VB ProgressBar
|
Total Hit (1482) |
Here's a quick SendMessage method to change the bar and / or backcolours of both a VB5 or VB6 progress bar, or an API-created progress bar. Note that on XP, using the 'Silver' theme, the default bar colour is grey, not the usual blue.
|
Rating
|
|
|
Detecting Windows Settings Changes
|
Total Hit (2469) |
This tip demonstrates how to detect windows settings changes in your application. You will need to have installed and registered the Subclassing and Timer Assistant (SSubTmr.DLL for VB5 and SSubTmr6.DLL for VB6), available from this site at Subclassing without the crashes to run this sample.
....Read More |
Rating
|
|
|
AVI Creation
|
Total Hit (2635) |
One thing that's always been tricky with AVIs is the lack of suitable software to create them. This article provides VB classes allowing 8-bit and 24-bit AVIs to be created, using any available Codec on the system. The demonstration project uses these classes to provide a pretty comprehensive progra
....Read More |
Rating
|
|
|
vbAccelerator TabStrip Control
|
Total Hit (1955) |
This control provides a fully functional implementation of the ComCtl32 TabStrip control. The control implements all the latest features, including support for Owner-Draw tabs, and is entirely coded in VB
|
Rating
|
|
|
Add Your App to the Systray the Easy Way
|
Total Hit (2624) |
This sample application presents a small form which you can drop into your project to get immediate SysTray support. A lot of the source code I've seen for VB SysTray interfaces has used an OCX or DLL and subclassed for a SysTray message, however, it turns out you don't need to do this, because you
....Read More |
Rating
|
|
|
Storing and Showing HTML Resources in a VB Application
|
Total Hit (1640) |
Since Internet Explorer 4, it is has been possible to display HTML directly from application resources using the res:// protocol. This article demonstrates how to embed HTML files and images into your application resources to use this function and encapsulate HTML files.
....Read More |
Rating
|
|