473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

passing Collections with VB6 COM objects

PJS
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?

Nov 21 '05 #1
1 2926
PJS
I found the answer:
http://support.microsoft.com/default...b;en-us;323737
"PJS" wrote:
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?

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
3
by: aa7im | last post by:
I am trying to design a good domain model for a system I am working on but I am having a hard time trying to figure out how to deal with relations and transaction... For example if I create an...
3
by: Stephen Travis | last post by:
I'm trying to write a subroutine that will fill an array of some type with several objects of that type. The subroutine works fine if I directly reference the array but if I pass the array as an...
2
by: PeteZ | last post by:
Can someone help me here. I'm having trouble finding details on how complex objects (eg. an object created in a code behind page that has imbedded object references, collections etc imbedded in...
3
by: Malcolm | last post by:
Hi. I am attempting something new in my coding and need some direction. I have a web service that I am attempting to return a custom colleciton of custom objects of a single type. When I call...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
2
by: =?Utf-8?B?Y3Nz?= | last post by:
I am new to ASP.net webservice and have a quesiton. Is is possible to pass custom object to a web service (using VB 2005)? My custom object will look like this Public Class Myclass Public...
5
by: Kenneth Porter | last post by:
How do I pass a container from C# to C++? My client is writing an app in C# that needs to pass a collection of 3- space vectors to my native C++ library. It will also need to read back the...
1
by: Ilyas | last post by:
Hi all What are the best practises for passing custom objects to and from from services? In particular: 1)Should datasets be passed, or custom objects be passed? 2)When it comes to passing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.