Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 it's VisualBasic.Collection), it gives me an error (error 13).

 

Is there a way to solve this problem?

 

Thank you

 

Anson:-\

Posted

yeah, that's 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

Posted

the error message i'm getting is exactly as follow:

 

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

 

I'm 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

Posted

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

  • Administrators
Posted

They were the ones I was thinking of.....

Just out of interest though

 

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?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...