Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for October, 2010

BUG: You receive a “Class not registered” error message in Visual Basic 6.0 project after you remove Visual Studio .NET or Visual Studio 2005

Symptoms
You have Visual Studio .NET or Visual Studio 2005 installed on your computer. You create a Visual Basic 6.0 project that has a control that is bound to a data source. When you remove Visual Studio .NET or Visual Studio 2005 and then run you Visual Basic 6.0 project, you receive the following error message:

Run-time error ‘713′:
Class not registered.
Looking for object with
CLSID:{59245250-7A2F-11D0-9842-00A0C91110ED}
Resolution
This problem occurs because the Component Object Model (COM) based MSBind.dll is unregistered when you remove Visual Studio .NET or Visual Studio 2005. Visual Basic 6.0 uses MSBind.dll to bind the control to the data source. Therefore, when you run a Visual Basic 6.0 project that has a data-bound control, you receive the run-time error message.

BUG: You may receive a “Visual Basic internal compiler error” error message when you use the ADDHANDLER statement or the REMOVEHANDLER statement in Visual Studio .NET

Symptoms
You can pass an array as a base reference to the event in the ADDHANDLER statement or in the REMOVEHANDLER statement in your application. However, when you try to compile your application, the compiler stops responding instead of displaying compilation errors. When you close the Microsoft Visual Studio .NET IDE, you may receive the following error message:

Visual Basic .NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler error)
Save your work and restart Visual Studio .NET.
Resolution
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

BUG: When You Remove Visual C# .NET an Error May Occur If You Try to Install Visual Studio Tools for Office

Symptoms
When you try to install Microsoft Visual Studio Tools for the Microsoft Office System on a computer with Microsoft Visual Basic .NET Standard 2003 installed, you may receive the following error message:

Setup cannot detect the required version of Visual Studio .NET on this computer.Before you install this product, you must install a matching regional version of Visual Studio .NET 2003 or Visual Basic .NET 2003 Standard.
Resolution
This error may occur if all the following conditions are sequentially true:Visual Basic .NET Standard 2003 is installed on the computer.Microsoft Visual C# .NET Standard 2003 is installed onthe computer.Visual C# .NET Standard 2003 isremoved.You try to installVisual Studio Tools for Office.

BUG: Visual Basic SendKeys causes incorrect keyboard status or freezes keyboard

Symptoms
You have a Microsoft Visual Basic program that uses the SendKeys function. The program works fine on Windows 95, Windows 98, or Windows NT-based computers. However, when you run the application on Windows 2000, either from the Desktop or through Terminal Services, the keyboard may freeze or go into an incorrect status.
Resolution
On Windows NT and Windows 2000, the Visual Basic SendKeys function toggles NUM LOCK, CAPS LOCK, and SCROLL LOCK when they are on. The Windows 2000 keyboard driver may not handle this behavior correctly, which causes the keyboard status to be incorrect or the keyboard to freeze.

BUG: Visual Basic Does Not Create an EXE File After Compiling

Symptoms
An EXE file is not created even though no errors are produced aftercompiling a Visual Basic application that includes a resource file.
Resolution
This will occur when including a resource file which contains a “Version”resource.

BUG: UserControl Containing ADO Data Control Fails to Unload

Symptoms
When a contained (inside a UserControl) control’s DataSource property is set to a contained ActiveX Data Objects (ADO) Data Control (MSADODC.OCX) at run-time, the container UserControl may fail to unload even when the form hosting the control is unloaded. As a result, the Terminate event of the UserControl does not fire as expected and if the form hosting the control is repeatedly loaded and unloaded, a memory leak may occur.
Resolution
To work around the problem, use a temporary recordset as described in the “More Information” section.