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 Tagged ‘visual basic application’

BUG: SSCommand Control Generates Application Error

Symptoms
An application error or general protection (GP) fault ending the VisualBasic design environment occurs when the Picture property of a SSCommand(3D command button) control is set to the default property of a PictureBoxcontrol located on another form, and the running application is stoppedusing only the End button on the Toolbar.
The bug occurs if you have a Visual Basic application containing one formwith a SSCommand control and another form with a PictureBox control. ThePicture property of the SSCommand control is set to the default property ofthe PictureBox control. The PictureBox control’s default property is itsPicture property.
When you run the application in the Visual Basic design environment and youclick the End button on the Toolbar to stop the application, an errormessage displays and Visual Basic ends. Note that the Close button on theform with the SSCommand control is not clicked.
Resolution
The workaround is to set the Picture property of the SSCommand control byexplicitly specifying the Picture property of the PictureBox control. DoNOT use the default property of the PictureBox control to set the Pictureproperty of the SSCommand control. An example of this is shown below in thecode in the More Information section.

BUG: Setup Wizard Closes With Error: Invalid Property Value…

Symptoms
When starting the Microsoft Visual Basic Application Setup Wizard, a dialogbox appears with the following error message:

Invalid property value, an unexpected error has occurred.
If you click OK, the Setup Wizard terminates.
Resolution
When the Setup Wizard begins, a system configuration file is read. If thedevices listed in the configuration file cannot be located, the erroroccurs and the Setup Wizard terminates.

BUG: Error “Unable to Register MSADO15.TLB” If You Use a PDW Package to Install a VB Application

Symptoms
When you use a package that you created with the Package and Deployment Wizard (PDW) to install a Visual Basic application, you may receive the following error message (or similar) during the installation:

Unable to register MSADO15.TLBThis error message may reference any of the following files:MSADO15.TLBMSADO20.TLBMSADO21.TLBMSADO25.TLB
Resolution
The Package and Deployment Wizard adds the type library (.tlb) file to the package because the type library is referenced in your project. The PDW also erroneously assigns the $(DLLSelfRegister) registration macro to the type library in the Setup.lst file that is created for your installation package.
Most commonly, this problem occurs when your Visual Basic project contains a reference to a version of ActiveX Data Objects (ADO) that is earlier than the latest installed version. The reference for the latest installed version of ADO points to MSADO15.DLL. Earlier version references point to the above-mentioned ADO type library files.

BUG: DTS Package Execution Is Canceled Unexpectedly in a Visual Basic Application

Symptoms
When you execute a multiple-step Data Transformation Services (DTS) package from a Visual Basic application in which the DTS event handlers are installed, the package execution may be canceled unexpectedly and you may receive the following error message:

Runtime error ‘-2147220441 (80040427)’: Execution was canceled by user.
Resolution
This problem occurs because the pbCancel Boolean flag in the OnQueryCancel event, without user intervention, is sometimes set to True unexpectedly, which causes package execution to be canceled prematurely.

BUG: Data Form Wizard Through Application Wizard Omits ADO Reference

Symptoms
When you run an application that is created using the Visual Basic Application Wizard, you receive the following error message:

Compile error: User-defined type not defined
Resolution
The Application Wizard allows for the creation of forms via the Data FormWizard. When a form is created in this manner, a reference to ADO is notadded to the project.