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 ‘type library’

PRB: IntelliSense Features Do Not Appear in Visual Basic 6.0 for .NET COM Interop Components

Symptoms
When you register a Microsoft Visual Basic .NET Component for COM Interop in the registry by using the Register for COM Interop option in Visual Studio .NET, the IntelliSense features for the methods and properties of the classes do not appear in your Visual Basic 6.0 application. Also, you cannot use early binding to bind to a method or a property.
Resolution
This problem occurs in the following scenario:When you use the Register for COM Interop option, the Visual Studio .NET build process calls the Regasm tool with the /TLB and /CODEBASE options to register the .NET Component for COM Interop.When you call to the Regasm tool, Visual Studio .NET creates a type library and a COM Callable Wrapper (CCW) Interop assembly.The type library is registered and acts as a COM object to gain access to the .NET assembly.By default, the Regasm tool creates a type library that exposes a non-dual, empty IDispatch interface. Therefore, you cannot use early binding. If you do not use early binding, the IntelliSense features do not appear.

PRB: IntelliSense Features Do Not Appear in Visual Basic 6.0 for .NET COM Interop Components

Symptoms
When you register a Microsoft Visual Basic .NET Component for COM Interop in the registry by using the Register for COM Interop option in Visual Studio .NET, the IntelliSense features for the methods and properties of the classes do not appear in your Visual Basic 6.0 application. Also, you cannot use early binding to bind to a method or a property.
Resolution
This problem occurs in the following scenario:When you use the Register for COM Interop option, the Visual Studio .NET build process calls the Regasm tool with the /TLB and /CODEBASE options to register the .NET Component for COM Interop.When you call to the Regasm tool, Visual Studio .NET creates a type library and a COM Callable Wrapper (CCW) Interop assembly.The type library is registered and acts as a COM object to gain access to the .NET assembly.By default, the Regasm tool creates a type library that exposes a non-dual, empty IDispatch interface. Therefore, you cannot use early binding. If you do not use early binding, the IntelliSense features do not appear.

PRB: Error Message “Missing or Not Registered VB6tmpl.tlb” When You Start Visual Basic 6.0

Symptoms
When you start Visual Basic 6.0 under a new user account or after a new install, and you try to run the Visual Basic 6.0 executable file (VB6.exe), you get the following error message:

Visual Basic was not able to start up due to invalid system configuration. Missing or not registered VB6tmpl.tlb.You are unable to continue and Visual Basic shuts down.
Resolution
The main Visual Basic type library is either missing or mis-registered for the current user. This message reflects the original working name of this file but in released versions of Visual Basic this file was renamed VB6.olb and is located in the same directory as the Visual Basic 6.0 executable (VB6.exe).
The registry should contain a path to this file under the following key:
HKEY_CLASSES_ROOT\TypeLib\{FCFB3D2E-A0FA-1068-A738-08002B3371B5}\6.0\9\win32If the key is missing or pointing to a location where the file cannot be found, Visual Basic returns the preceding error message during startup.

PRB: ADO: Compile Error: User-Defined Type Not Defined

Symptoms
When you compile your ADO project, you receive the following error:

Compile error:User-defined type not definedThis can occur on either a Connection or Command object.
Resolution
You may have referenced one of the following libraries instead of theMicrosoft ActiveX Data Objects (ADODB) type library:Microsoft ActiveX Data Objects Recordset (ADOR) type library.
-or-Microsoft ActiveX Data Objects (Multi-dimensional) (ADOMD) type library.

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.