Collection Argument becomes VBA.Collection

Graphite2001

Member
Joined
Sep 30, 2003
Messages
12
Hello All,

I have a problem with a VB.net project using ActiveX user control.

There is a method in my user control that takes a collection as an argument (originally in VB6).

However, after i upgraded the whole project into VB.Net, everything works out perfectly except for this particular function. Now when i look at the function signature from the intellisense, i see that the argument becomes a VBA.Collection. Thus, if i passed in a regular collecton that i dim in my .NET project ( i think its VisualBasic.Collection), it gives me an error (error 13).

Is there a way to solve this problem?

Thank you

Anson:-\
 
Probably not. If the control is expecting a VBA.Collection thats what you will have to provide.

Would re-writing the control be a valid option?
 
yeah, thats is a valid option.


however, is it possible for me to declare a VBA.Collection instead of VisualBasic.Collection in my project? Then i pass my VBA.Collection to my control. (assuming this VBA.Collection only uses once.)

I tried this, but it gives me an error 429.


Anson
 
If you set a reference to the VisualBasic compatability layer you should be able to declare a VBA.Collection. What code are you using that gives the error 429?
 
the error message im getting is exactly as follow:

Error 429, COM object with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} is either not valid or not registered

Im running in the following statement that gives me this message.


Dim EventCollectionDAY(42) As VBA.Collection

For i = 0 To 41
EventCollectionDAY(i) = New VBA.Collection
This is where i get the error message
Next i

Call MyControl(i).Set_EventList(EventCollectionDAY(i))
MyControl is an AX Control from VB6
Set_EventList takes VBA.Collection as an argument.




Anson
 
I just double checked my project. I found that i already have the following 2 references:

Microsoft.VisualBasic.Compatibility
Microsoft.VisualBasic.Compatibility.Data


Are those the 2 reference you were mention in the previous email?


Anson
 
They were the ones I was thinking of.....
Just out of interest though

Code:
Dim EventCollectionDAY(42) As VBA.Collection

For i = 0 To 41
EventCollectionDAY(i) = New VBA.Collection
Next i
will be declaring an array of 43 collections and initalizing the first 42 of them - is that what you wanted to do there?
 
Back
Top