devxlogo

Tip Bank

GetMdacVersion – Retrieve the installed MDAC version

‘ Retrieve the installed MDAC version” Examples:’ Dim ver As Version = GetMdacVersion()’ ‘ print the full version’ MessageBox.Show(ver.ToString())’ ‘ print the major and minor portions’ MessageBox.Show(“Major: ” & ver.Major

IsKeyPressed – Check whether a key is pressed

Private Shared _ Function GetAsyncKeyState(ByVal key As Keys) As IntegerEnd Function’ Check whether a key is pressed, at any given time’ Example: MessageBox.Show(IsKeyPressed(Keys.A))Function IsKeyPressed(ByVal key As Keys) As Boolean Return

The Debug and Release Check Technique

Assertions are excellent at catching bugs during development. However, some checks need to be performed at runtime for production code as well. A good way to wrap the two is

Use Interfaces to Increase Source Code Flexibility

Where possible, use interfaces (as opposed to interface-implementation classes) to increase your source code’s flexibility. If you later need to change an interface-implementation class (to improve performance, for example), it’s

Copy Filenames to a Clipboard

File hierarchies are becoming more complex and file paths longer as the capacity of hard drives increases. There are still many occasions, however, when you can’t browse to identify a