Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Saturday, October 21, 2017

Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 


Home > Search > Knowledge Base > Visual Basic.Net > Errors and Bugs > VB.NET BUG
BUG: "System.InvalidCastException" Error Message When You Pass a Collection from a .NET-Connected Application to Visual Basic 6.0 Components        
Total Hits: 284  |  Today: 0       Rating:  
Read Reviews | Write Review | Your Rating: 

When you try to pass a Collection object from Microsoft Visual Basic .NET to Visual Basic 6.0 components, you may receive the following error message:

An unhandled exception of type 'System.InvalidCastException' occurred in ApplicationName.exe
Additional information: Specified cast is not valid.

If you examine the type of the collection object that Visual Basic .NET expects, you find that the VBA.Collection type is expected instead of the Microsoft.VisualBasic.Collection type. If you change your code to pass a collection object of the type VBA.Collection, you receive the following error message on the line of code where you try to create a new instance of the VBA.Collection class:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ApplicationName.exe
Additional information: COM object with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} is either not valid or not registered.


What's New at DevASP.Net
04/23  A Debug Stopwatch
04/23  The virtual bool bug
04/23  Application.EnableVisualStyles Bu..
04/23  The Process Async Reader Bug
04/23  Load a DBF into a DataTable
04/23  Weird Error: Unable to Validate D..
04/23  ASP.NET and jQuery to the Max
04/23  Fixing Error: "SetConfigurationSe..
04/23  Generics in .NET
04/23  Builder Design Pattern
04/23  Abstract Factory Design Pattern
04/23  Prototype Design Pattern
04/23  Bridge Design Pattern
04/23  Composite Design Pattern
04/23  Decorator Design Pattern
04/23  Validation in .NET Framework 4
04/23  Windows Phone 7: How to Encrypt C..
04/23  Text box to accept only number
04/23  Using the Raw Input API to Proces..
04/23  Study EVM (Earned Value Managemen..

DevASP.Net - Disclaimer - Privacy
2002-2010 DevASP.net