Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

passing Collections with VB6 COM objects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PJS - 29 Oct 2004 19:39 GMT
I am trying to use a COM object which has a parameter of type Collection in
VB6. .Net recognizes this collection as a VBA.Collection object. When I try
creating a VBA.Collection in .Net using:

Dim objColl As New VBA.CollectionClass()

I get the following error:
An unhandled exception of
type 'System.Runtime.InteropServices.COMException'
occurred in WindowsApplication4.exe

Additional information: COM object with CLSID {A4C4671C-
499F-101B-BB78-00AA00383CBB} is either not valid or not
registered.

If I try passing a .Net Collection for example:
Dim objColl As New Collection()
Dim objZip As New CILZip.CIZipClass()
objColl.Add("C:\test.xml")
objZip.Archive(objColl, "c:\Test.zip")

I get the following error when I call the COM object:
An unhandled exception of
type 'System.InvalidCastException' occurred in
WindowsApplication4.exe

Additional information: Specified cast is not valid.

Am I overlooking something or is a collection a
unsupported type of interop?
PJS - 29 Oct 2004 21:23 GMT
I found the answer:
http://support.microsoft.com/default.aspx?scid=kb;en-us;323737

> I am trying to use a COM object which has a parameter of type Collection in
> VB6. .Net recognizes this collection as a VBA.Collection object. When I try
[quoted text clipped - 26 lines]
> Am I overlooking something or is a collection a
> unsupported type of interop?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.