devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Use Sleep API to add pauses to your programs

Don’t use an empty For…Next loop to add pauses to your programs; instead, use the Sleep API function, that releases the CPU and lets other apps in the system effectively

GoSub are slower in compiled programs

In VB applications compiled as native code, GoSubs are 5-6 times slower than calls to regular Subs or Functions; conversely, in p-code they are considerably faster. This is one of

Upgrade to the most recent Service Pack

OK, this is a silly suggestion, but I personally know a lot of developers that complain about Visual Basic’s bugs that were fixed in more recent Service Packs. This is

And is faster the Mod

Use the And operator instead of Mod when the divisor is a number in the form 2^N. For instance, there are two methods to extract the least significant byte in

Always declare objects with full library name

If your application uses objects from external components, either third-party or your own libraries, a good rule of thumb is to include the complete servername.classname string in the Dim statement,

ProjectName – The name of the current project

‘ Returns the name of the current project’ The first time it’s called it clears the error code’Function ProjectName() As String Static result As String If Len(result) = 0 Then

Use integer division operator

Use “” instead of “/” when performing divisions between Integers. The “/” operator returns a Single value, therefore the seemingly efficient line C% = A% / B% actually requires three

Where on Earth is an Add-ins’s Description

Every now and then someone asks me “How can I modify the default description that is associated to an add-in I have written and that appears in the Add-In Manager?

Reduce the number of DoEvents

Don’t fill your code with unnecessary DoEvents statements, especially within time-critical loops. If you can’t avoid that, at least you can reduce the overhead by invoking DoEvents only every N

GetShortFileName – Convert a filename to 8.3 format

Private Declare Function GetShortPathName Lib “kernel32” Alias _ “GetShortPathNameA” (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long’ Convert a long filename into the

Hide the Automation Manager

If you haven’t switched to DCOM yet, and still use Remote OLE Automation, you must launch the Automation Manager program on the server machine, in order to let the server

Topmost windows

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.

Plug the Security Holes

We all know to keep the sa password secret and to share it with as few people as necessary. However, users see no problem with registering their server in Enterprise

The Volatile Storage Qualifier

The const qualifier guarantees that the value of an object cannot be changed directly by the program. However, it may be altered asynchronously–that is, by a way unknown to the

Replace Form Reset Button With an Image

You may already know how to replace the default gray form submit button with an image (see Tip “Replace Form Buttons With Images”), but do you know how to replace

TextArea With Word Wrap

The default behavior for a java.awt.TextArea is to scroll the text you enter to the left once the length of the line of text exceeds the displayable area. When this

Process string characters using Byte arrays

When you need to process each character in a string, you can assign the string to a byte array and iterate on its elements (remember: each Unicode character corresponds to

Is the Active Desktop Active?

Sometimes you want to know if the desktop is in Active Desktop mode-for example, to set an HTML wallpaper. I couldn’t find a function to accomplish this, but this hack

Grab System Fonts Easily

At times, you might want to retrieve the current system font settings, such as the font being used for window title bars, or the menu or message box font. You

Make Sure Data is Updated

When using bound controls, data is updated automatically when you Move to a different record. Data is not updated when you close the form. To ensure that data is saved

Setting the Log Stream

When debugging Java Database Connectivity (JDBC) problems, it can be difficult to locate the source of errors. However, one facility that can be used to accomplish this is the logging/tracing